Class: TestRunner::TestResult
- Inherits:
-
Object
- Object
- TestRunner::TestResult
- Defined in:
- lib/test-runner/test_result.rb
Instance Attribute Summary collapse
-
#elapsed_time ⇒ Object
readonly
Returns the value of attribute elapsed_time.
-
#state_dir ⇒ Object
readonly
Returns the value of attribute state_dir.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
-
#test ⇒ Object
readonly
Returns the value of attribute test.
Instance Method Summary collapse
- #expected_result? ⇒ Boolean
- #expected_to_fail? ⇒ Boolean
- #expected_to_succeed? ⇒ Boolean
- #failed? ⇒ Boolean
-
#initialize(test, success, elapsed_time, state_dir) ⇒ TestResult
constructor
A new instance of TestResult.
- #successful? ⇒ Boolean
- #unexpected_result? ⇒ Boolean
Constructor Details
#initialize(test, success, elapsed_time, state_dir) ⇒ TestResult
Returns a new instance of TestResult.
5 6 7 8 9 10 |
# File 'lib/test-runner/test_result.rb', line 5 def initialize(test, success, elapsed_time, state_dir) @test = test @success = success @elapsed_time = elapsed_time @state_dir = state_dir end |
Instance Attribute Details
#elapsed_time ⇒ Object (readonly)
Returns the value of attribute elapsed_time.
3 4 5 |
# File 'lib/test-runner/test_result.rb', line 3 def elapsed_time @elapsed_time end |
#state_dir ⇒ Object (readonly)
Returns the value of attribute state_dir.
3 4 5 |
# File 'lib/test-runner/test_result.rb', line 3 def state_dir @state_dir end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
3 4 5 |
# File 'lib/test-runner/test_result.rb', line 3 def success @success end |
#test ⇒ Object (readonly)
Returns the value of attribute test.
3 4 5 |
# File 'lib/test-runner/test_result.rb', line 3 def test @test end |
Instance Method Details
#expected_result? ⇒ Boolean
20 21 22 23 24 25 26 |
# File 'lib/test-runner/test_result.rb', line 20 def expected_result? if test.expect_failure !@success else @success end end |
#expected_to_fail? ⇒ Boolean
36 37 38 |
# File 'lib/test-runner/test_result.rb', line 36 def expected_to_fail? test.expect_failure end |
#expected_to_succeed? ⇒ Boolean
32 33 34 |
# File 'lib/test-runner/test_result.rb', line 32 def expected_to_succeed? !test.expect_failure end |
#failed? ⇒ Boolean
16 17 18 |
# File 'lib/test-runner/test_result.rb', line 16 def failed? !@success end |
#successful? ⇒ Boolean
12 13 14 |
# File 'lib/test-runner/test_result.rb', line 12 def successful? @success end |
#unexpected_result? ⇒ Boolean
28 29 30 |
# File 'lib/test-runner/test_result.rb', line 28 def unexpected_result? !expected_result? end |