Class: Loupe::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/loupe/rake_task.rb

Overview

Loupe’s test rake task

Define a rake task so that we can hook into ‘rake test` an run the suite using Loupe. To hook it up, add this to the Rakefile

require “loupe/rake_task”

Loupe::RakeTask.new do |options|

options << "--plain"
options << "--ractor"

end

Then run with ‘bundle exec rake test`

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|@options| ... } ⇒ Loupe::RakeTask

Yields:

  • (@options)


26
27
28
29
30
31
32
33
34
35
36
# File 'lib/loupe/rake_task.rb', line 26

def initialize
  super

  @name = "test"
  @description = "Run tests using Loupe"
  @libs = %w[lib test]
  @options = []
  ARGV.shift if ARGV.first == "test"
  yield(@options)
  define
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



23
24
25
# File 'lib/loupe/rake_task.rb', line 23

def description
  @description
end

#libsObject

Returns the value of attribute libs.



23
24
25
# File 'lib/loupe/rake_task.rb', line 23

def libs
  @libs
end

#nameObject

Returns the value of attribute name.



23
24
25
# File 'lib/loupe/rake_task.rb', line 23

def name
  @name
end