Module: Protest::TestWithErrors
- Included in:
- ErroredTest, FailedTest, PendingTest
- Defined in:
- lib/protest/tests.rb
Overview
Mixin for tests that had an error (this could be either a failed assertion, unrescued exceptions, or just a pending tests.)
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
The triggered exception (AssertionFailed, Pending, or any subclass of Exception in the case of an ErroredTest.).
Instance Method Summary collapse
-
#backtrace ⇒ Object
Filtered backtrace of the assertion.
-
#error_message ⇒ Object
Message with which it failed the assertion.
-
#file ⇒ Object
File where the assertion failed.
-
#line ⇒ Object
Line of the file where the assertion failed.
-
#raw_backtrace ⇒ Object
Raw backtrace, as provided by the error.
Instance Attribute Details
#error ⇒ Object (readonly)
The triggered exception (AssertionFailed, Pending, or any subclass of Exception in the case of an ErroredTest.)
22 23 24 |
# File 'lib/protest/tests.rb', line 22 def error @error end |
Instance Method Details
#backtrace ⇒ Object
Filtered backtrace of the assertion. See Protest::Utils::BacktraceFilter for details on the filtering.
41 42 43 |
# File 'lib/protest/tests.rb', line 41 def backtrace @backtrace ||= Protest.backtrace_filter.filter_backtrace(raw_backtrace) end |
#error_message ⇒ Object
Message with which it failed the assertion.
25 26 27 |
# File 'lib/protest/tests.rb', line 25 def error. end |
#file ⇒ Object
File where the assertion failed.
35 36 37 |
# File 'lib/protest/tests.rb', line 35 def file backtrace.first.split(":")[0] end |
#line ⇒ Object
Line of the file where the assertion failed.
30 31 32 |
# File 'lib/protest/tests.rb', line 30 def line backtrace.first.split(":")[1] end |
#raw_backtrace ⇒ Object
Raw backtrace, as provided by the error.
46 47 48 |
# File 'lib/protest/tests.rb', line 46 def raw_backtrace error.backtrace end |