Class: Assert::Runner
- Inherits:
-
Object
- Object
- Assert::Runner
- Defined in:
- lib/assert/runner.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config) ⇒ Runner
constructor
A new instance of Runner.
- #run(suite, view) ⇒ Object
Constructor Details
#initialize(config) ⇒ Runner
Returns a new instance of Runner.
9 10 11 |
# File 'lib/assert/runner.rb', line 9 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/assert/runner.rb', line 7 def config @config end |
Instance Method Details
#run(suite, view) ⇒ Object
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/assert/runner.rb', line 13 def run(suite, view) raise ArgumentError if !suite.kind_of?(Suite) view.fire(:on_start) begin suite.setup suite.start_time = Time.now tests_to_run(suite).each do |test| view.fire(:before_test, test) test.run{ |result| view.fire(:on_result, result) } view.fire(:after_test, test) end suite.end_time = Time.now suite.teardown rescue Interrupt => err view.fire(:on_interrupt, err) raise(err) end view.fire(:on_finish) suite.count(:failed) + suite.count(:errored) end |