Class: Bozo::TestRunners::Runit
- Inherits:
-
Object
- Object
- Bozo::TestRunners::Runit
- Defined in:
- lib/bozo/test_runners/runit.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ Runit
constructor
A new instance of Runit.
- #path(path) ⇒ Object
Constructor Details
#initialize ⇒ Runit
Returns a new instance of Runit.
5 6 7 |
# File 'lib/bozo/test_runners/runit.rb', line 5 def initialize @paths = [] end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/bozo/test_runners/runit.rb', line 13 def execute require 'test/unit' test_files = [] @paths.each do |p| Dir[p].select {|f| (File.extname f) == '.rb'}.each {|f| test_files << f} end # raise an error if no test files were found. This may indicate a configuration issue raise Bozo::ConfigurationError.new "No tests found" unless test_files.any? raise Bozo::ExecutionError.new(:runit, test_files, -1) unless execute_tests test_files end |
#path(path) ⇒ Object
9 10 11 |
# File 'lib/bozo/test_runners/runit.rb', line 9 def path(path) @paths << path end |