Class: Journo::TestRunner
- Inherits:
-
Object
- Object
- Journo::TestRunner
- Defined in:
- lib/journo/test_runner.rb
Overview
Runner for individual MiniTest tests.
You should not create instances of this class directly. Instances of SuiteRunner will create these and send them to the reporters.
Based upon Ryan Davis of Seattle.rb's MiniTest (MIT License).
Instance Attribute Summary collapse
-
#assertions
readonly
Returns the value of attribute assertions.
-
#exception
readonly
Returns the value of attribute exception.
-
#result
readonly
Returns the value of attribute result.
-
#suite
readonly
Returns the value of attribute suite.
-
#test
readonly
Returns the value of attribute test.
Instance Method Summary collapse
-
#initialize(suite, test) ⇒ TestRunner
constructor
A new instance of TestRunner.
- #puke(suite, test, exception)
- #run
Constructor Details
#initialize(suite, test) ⇒ TestRunner
Returns a new instance of TestRunner.
13 14 15 16 17 |
# File 'lib/journo/test_runner.rb', line 13 def initialize(suite, test) @suite = suite @test = test @assertions = 0 end |
Instance Attribute Details
#assertions (readonly)
Returns the value of attribute assertions.
11 12 13 |
# File 'lib/journo/test_runner.rb', line 11 def assertions @assertions end |
#exception (readonly)
Returns the value of attribute exception.
11 12 13 |
# File 'lib/journo/test_runner.rb', line 11 def exception @exception end |
#result (readonly)
Returns the value of attribute result.
11 12 13 |
# File 'lib/journo/test_runner.rb', line 11 def result @result end |
#suite (readonly)
Returns the value of attribute suite.
11 12 13 |
# File 'lib/journo/test_runner.rb', line 11 def suite @suite end |
#test (readonly)
Returns the value of attribute test.
11 12 13 |
# File 'lib/journo/test_runner.rb', line 11 def test @test end |
Instance Method Details
#puke(suite, test, exception)
25 26 27 28 29 30 31 |
# File 'lib/journo/test_runner.rb', line 25 def puke(suite, test, exception) case exception when MiniTest::Skip then [:skip, exception] when MiniTest::Assertion then [:failure, exception] else [:error, exception] end end |
#run
19 20 21 22 23 |
# File 'lib/journo/test_runner.rb', line 19 def run suite_instance = suite.new(test) @result, @exception = fix_result(suite_instance.run(self)) @assertions = suite_instance._assertions end |