Class: Reap::TestTask
- Inherits:
-
Task
- Object
- Task
- Reap::TestTask
show all
- Defined in:
- lib/reap/tasks/test-task.rb
Constant Summary
Constants inherited
from Task
Reap::Task::DEFAULT_INCLUDE, Reap::Task::MUST_EXCLUDE, Reap::Task::RUBY
Instance Attribute Summary
Attributes inherited from Task
#config, #section
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Task
#[], inherited, #initialize, #package_name, registry, #ruby, #sh, tasks
Constructor Details
This class inherits a constructor from Reap::Task
Class Method Details
.desc ⇒ Object
8
|
# File 'lib/reap/tasks/test-task.rb', line 8
def self.desc ; "Run unit tests." ; end
|
.task ⇒ Object
6
|
# File 'lib/reap/tasks/test-task.rb', line 6
def self.task ; :test ; end
|
Instance Method Details
#run ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/reap/tasks/test-task.rb', line 18
def run
test_libs = @libs
test_files = FileList.new
test_files.include(*@files)
if test_files.empty?
puts "No test files found."
return
end
puts "Reap is shelling out work to Ruby's Test Suite..."
begin
test_files.each { |f|
ruby %{-r"test/unit" "#{f}"}
}
rescue
puts "Error occured while trying to run tests."
exit 0
end
end
|
#set(section) ⇒ Object
11
12
13
14
15
16
|
# File 'lib/reap/tasks/test-task.rb', line 11
def set( section )
@libs = ( section["libs"] || ['lib'] ).join(':')
@files = section["files"] || [ 'test/**/tc*.rb', 'test/**/test*.rb', 'test/**/*test.rb' ]
@options = section['options']
end
|