Class: Smartest::Runner
- Inherits:
-
Object
- Object
- Smartest::Runner
- Defined in:
- lib/smartest/runner.rb
Instance Method Summary collapse
-
#initialize(suite: Smartest.suite, reporter: Reporter.new) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/smartest/runner.rb', line 10 def run results = [] suite_cleanup_errors = [] @suite_fixture_set = nil @reporter.start(@suite.tests.count) begin @suite.tests.each do |test_case| result = run_one(test_case) results << result @reporter.record(result) end ensure suite_cleanup_errors = @suite_fixture_set.run_cleanups if @suite_fixture_set @suite_fixture_set = nil end @reporter.finish(results, suite_cleanup_errors: suite_cleanup_errors) results.any?(&:failed?) || suite_cleanup_errors.any? ? 1 : 0 end |