Class: CI::Reporter::RSpecFailure
- Inherits:
-
Object
- Object
- CI::Reporter::RSpecFailure
- Defined in:
- lib/ci/reporter/rspec.rb
Overview
Wrapper around a RSpec
error or failure to be used by the test suite to interpret results.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
Instance Method Summary collapse
- #error? ⇒ Boolean
- #failure? ⇒ Boolean
-
#initialize(failure) ⇒ RSpecFailure
constructor
A new instance of RSpecFailure.
- #location ⇒ Object
- #message ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(failure) ⇒ RSpecFailure
Returns a new instance of RSpecFailure.
38 39 40 41 |
# File 'lib/ci/reporter/rspec.rb', line 38 def initialize(failure) @failure = failure @exception = failure.exception end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
37 38 39 |
# File 'lib/ci/reporter/rspec.rb', line 37 def exception @exception end |
Instance Method Details
#error? ⇒ Boolean
47 48 49 |
# File 'lib/ci/reporter/rspec.rb', line 47 def error? !failure? end |
#failure? ⇒ Boolean
43 44 45 |
# File 'lib/ci/reporter/rspec.rb', line 43 def failure? @failure.expectation_not_met? end |
#location ⇒ Object
53 |
# File 'lib/ci/reporter/rspec.rb', line 53 def location() (exception.backtrace || ["No backtrace available"]).join("\n") end |
#message ⇒ Object
52 |
# File 'lib/ci/reporter/rspec.rb', line 52 def () exception. end |
#name ⇒ Object
51 |
# File 'lib/ci/reporter/rspec.rb', line 51 def name() exception.class.name end |