Class: Testicles::Report::FailedTest
- Inherits:
-
PassedTest
- Object
- PassedTest
- Testicles::Report::FailedTest
- Defined in:
- lib/testicles/report.rb
Overview
Encapsulates the relevant information for a test which failed an assertion.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from PassedTest
Instance Method Summary collapse
-
#backtrace ⇒ Object
Backtrace of the assertion.
-
#error_message ⇒ Object
Message with which it failed the assertion.
-
#file ⇒ Object
File where the assertion failed.
-
#initialize(test_name, error) ⇒ FailedTest
constructor
:nodoc:.
-
#line ⇒ Object
Line of the file where the assertion failed.
Constructor Details
#initialize(test_name, error) ⇒ FailedTest
:nodoc:
135 136 137 138 |
# File 'lib/testicles/report.rb', line 135 def initialize(test_name, error) #:nodoc: super(test_name) @error = error end |
Instance Method Details
#backtrace ⇒ Object
Backtrace of the assertion
156 157 158 |
# File 'lib/testicles/report.rb', line 156 def backtrace @error.backtrace end |
#error_message ⇒ Object
Message with which it failed the assertion
141 142 143 |
# File 'lib/testicles/report.rb', line 141 def @error. end |
#file ⇒ Object
File where the assertion failed
151 152 153 |
# File 'lib/testicles/report.rb', line 151 def file backtrace.first.split(":")[0] end |
#line ⇒ Object
Line of the file where the assertion failed
146 147 148 |
# File 'lib/testicles/report.rb', line 146 def line backtrace.first.split(":")[1] end |