Class: Assert::RakeTasks::TestTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Assert::RakeTasks::TestTask
- Defined in:
- lib/assert/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.
29 30 31 32 33 34 |
# File 'lib/assert/rake_tasks.rb', line 29 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.
26 27 28 |
# File 'lib/assert/rake_tasks.rb', line 26 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
26 27 28 |
# File 'lib/assert/rake_tasks.rb', line 26 def name @name end |
#test_files ⇒ Object
Returns the value of attribute test_files.
26 27 28 |
# File 'lib/assert/rake_tasks.rb', line 26 def test_files @test_files end |
Instance Method Details
#file_list ⇒ Object
:nodoc:
44 45 46 |
# File 'lib/assert/rake_tasks.rb', line 44 def file_list # :nodoc: @test_files.collect{|f| "\"#{f}\""}.join(' ') end |
#to_task ⇒ Object
Define the rake task to run this test suite
37 38 39 40 41 42 |
# File 'lib/assert/rake_tasks.rb', line 37 def to_task desc @description task @name do RakeFileUtils.verbose(true) { ruby "\"#{rake_loader}\" " + file_list } end end |