Class: TLDR::TestResult
- Inherits:
-
Struct
- Object
- Struct
- TLDR::TestResult
- Defined in:
- lib/tldr/value/test_result.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#error_location ⇒ Object
readonly
Returns the value of attribute error_location.
-
#runtime ⇒ Object
Returns the value of attribute runtime.
-
#test ⇒ Object
Returns the value of attribute test.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #error? ⇒ Boolean
- #failing? ⇒ Boolean
- #failure? ⇒ Boolean
-
#initialize(*args) ⇒ TestResult
constructor
A new instance of TestResult.
- #passing? ⇒ Boolean
- #relevant_location ⇒ Object
- #skip? ⇒ Boolean
- #success? ⇒ Boolean
Constructor Details
#initialize(*args) ⇒ TestResult
Returns a new instance of TestResult.
5 6 7 8 9 |
# File 'lib/tldr/value/test_result.rb', line 5 def initialize(*args) super @type = determine_type @error_location = determine_error_location end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error
2 3 4 |
# File 'lib/tldr/value/test_result.rb', line 2 def error @error end |
#error_location ⇒ Object (readonly)
Returns the value of attribute error_location.
3 4 5 |
# File 'lib/tldr/value/test_result.rb', line 3 def error_location @error_location end |
#runtime ⇒ Object
Returns the value of attribute runtime
2 3 4 |
# File 'lib/tldr/value/test_result.rb', line 2 def runtime @runtime end |
#test ⇒ Object
Returns the value of attribute test
2 3 4 |
# File 'lib/tldr/value/test_result.rb', line 2 def test @test end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/tldr/value/test_result.rb', line 3 def type @type end |
Instance Method Details
#error? ⇒ Boolean
31 32 33 |
# File 'lib/tldr/value/test_result.rb', line 31 def error? type == :error end |
#failing? ⇒ Boolean
15 16 17 |
# File 'lib/tldr/value/test_result.rb', line 15 def failing? !passing? end |
#failure? ⇒ Boolean
27 28 29 |
# File 'lib/tldr/value/test_result.rb', line 27 def failure? type == :failure end |
#passing? ⇒ Boolean
11 12 13 |
# File 'lib/tldr/value/test_result.rb', line 11 def passing? success? || skip? end |
#relevant_location ⇒ Object
35 36 37 |
# File 'lib/tldr/value/test_result.rb', line 35 def relevant_location error_location || test.location end |
#skip? ⇒ Boolean
23 24 25 |
# File 'lib/tldr/value/test_result.rb', line 23 def skip? type == :skip end |
#success? ⇒ Boolean
19 20 21 |
# File 'lib/tldr/value/test_result.rb', line 19 def success? type == :success end |