Class: TestBelt::RakeTasks::TestTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- TestBelt::RakeTasks::TestTask
- Defined in:
- lib/test_belt/rake_tasks.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
-
#test_files ⇒ Object
Returns the value of attribute test_files.
Instance Method Summary collapse
-
#file_list ⇒ Object
:nodoc:.
-
#initialize(name = :test) {|_self| ... } ⇒ TestTask
constructor
Create a testing task.
-
#to_task ⇒ Object
Define the rake task to run this test suite.
Constructor Details
#initialize(name = :test) {|_self| ... } ⇒ TestTask
Create a testing task.
13 14 15 16 17 18 |
# File 'lib/test_belt/rake_tasks.rb', line 13 def initialize(name=:test) @name = name @description = "Run tests" + (@name==:test ? "" : " for #{@name}") @test_files = [] yield self if block_given? end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
10 11 12 |
# File 'lib/test_belt/rake_tasks.rb', line 10 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/test_belt/rake_tasks.rb', line 10 def name @name end |
#test_files ⇒ Object
Returns the value of attribute test_files.
10 11 12 |
# File 'lib/test_belt/rake_tasks.rb', line 10 def test_files @test_files end |
Instance Method Details
#file_list ⇒ Object
:nodoc:
28 29 30 |
# File 'lib/test_belt/rake_tasks.rb', line 28 def file_list # :nodoc: @test_files.collect{|f| "\"#{f}\""}.join(' ') end |
#to_task ⇒ Object
Define the rake task to run this test suite
21 22 23 24 25 26 |
# File 'lib/test_belt/rake_tasks.rb', line 21 def to_task desc @description task @name do RakeFileUtils.verbose(true) { ruby "\"#{rake_loader}\" " + file_list } end end |