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.
33 34 35 36 |
# File 'lib/ci/reporter/rspec.rb', line 33 def initialize(failure) @failure = failure @exception = failure.exception end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
32 33 34 |
# File 'lib/ci/reporter/rspec.rb', line 32 def exception @exception end |
Instance Method Details
#error? ⇒ Boolean
42 43 44 |
# File 'lib/ci/reporter/rspec.rb', line 42 def error? !failure? end |
#failure? ⇒ Boolean
38 39 40 |
# File 'lib/ci/reporter/rspec.rb', line 38 def failure? @failure.expectation_not_met? end |
#location ⇒ Object
48 |
# File 'lib/ci/reporter/rspec.rb', line 48 def location() @example.[:execution_result][:exception].backtrace.join("\n") end |
#message ⇒ Object
47 |
# File 'lib/ci/reporter/rspec.rb', line 47 def () @example.[:execution_result][:exception]. end |
#name ⇒ Object
46 |
# File 'lib/ci/reporter/rspec.rb', line 46 def name() @example.[:execution_result][:exception].class.name end |