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, tests: nil) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(suite: Smartest.suite, reporter: Reporter.new, tests: nil) ⇒ Runner
Returns a new instance of Runner.
5 6 7 8 9 |
# File 'lib/smartest/runner.rb', line 5 def initialize(suite: Smartest.suite, reporter: Reporter.new, tests: nil) @suite = suite @reporter = reporter @tests = tests || suite.tests end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/smartest/runner.rb', line 11 def run results = [] suite_cleanup_errors = [] suite_errors = [] @suite_fixture_set = nil @reporter.start(@tests.count) begin run_around_suite_hooks(@suite.around_suite_hooks.dup) do run_tests(results, suite_cleanup_errors) end rescue Exception => error raise if Smartest.fatal_exception?(error) suite_errors << error end @reporter.finish( results, suite_cleanup_errors: suite_cleanup_errors, suite_errors: suite_errors ) results.any?(&:failed?) || suite_cleanup_errors.any? || suite_errors.any? ? 1 : 0 end |