Class: Smartest::TestResult
- Inherits:
-
Object
- Object
- Smartest::TestResult
- Defined in:
- lib/smartest/test_result.rb
Instance Attribute Summary collapse
-
#cleanup_errors ⇒ Object
readonly
Returns the value of attribute cleanup_errors.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#test_case ⇒ Object
readonly
Returns the value of attribute test_case.
Class Method Summary collapse
- .failed(test_case:, error:, duration:, cleanup_errors: []) ⇒ Object
- .passed(test_case:, duration:, cleanup_errors: []) ⇒ Object
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(test_case:, status:, error:, duration:, cleanup_errors:) ⇒ TestResult
constructor
A new instance of TestResult.
- #passed? ⇒ Boolean
Constructor Details
#initialize(test_case:, status:, error:, duration:, cleanup_errors:) ⇒ TestResult
Returns a new instance of TestResult.
27 28 29 30 31 32 33 |
# File 'lib/smartest/test_result.rb', line 27 def initialize(test_case:, status:, error:, duration:, cleanup_errors:) @test_case = test_case @status = status @error = error @duration = duration @cleanup_errors = cleanup_errors end |
Instance Attribute Details
#cleanup_errors ⇒ Object (readonly)
Returns the value of attribute cleanup_errors.
5 6 7 |
# File 'lib/smartest/test_result.rb', line 5 def cleanup_errors @cleanup_errors end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
5 6 7 |
# File 'lib/smartest/test_result.rb', line 5 def duration @duration end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
5 6 7 |
# File 'lib/smartest/test_result.rb', line 5 def error @error end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/smartest/test_result.rb', line 5 def status @status end |
#test_case ⇒ Object (readonly)
Returns the value of attribute test_case.
5 6 7 |
# File 'lib/smartest/test_result.rb', line 5 def test_case @test_case end |
Class Method Details
.failed(test_case:, error:, duration:, cleanup_errors: []) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/smartest/test_result.rb', line 17 def self.failed(test_case:, error:, duration:, cleanup_errors: []) new( test_case: test_case, status: :failed, error: error, duration: duration, cleanup_errors: cleanup_errors ) end |
.passed(test_case:, duration:, cleanup_errors: []) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/smartest/test_result.rb', line 7 def self.passed(test_case:, duration:, cleanup_errors: []) new( test_case: test_case, status: :passed, error: nil, duration: duration, cleanup_errors: cleanup_errors ) end |
Instance Method Details
#failed? ⇒ Boolean
39 40 41 |
# File 'lib/smartest/test_result.rb', line 39 def failed? status == :failed end |
#passed? ⇒ Boolean
35 36 37 |
# File 'lib/smartest/test_result.rb', line 35 def passed? status == :passed end |