Class: RSpecDocumentation::RSpec::Failure
- Inherits:
-
Object
- Object
- RSpecDocumentation::RSpec::Failure
- Includes:
- Paintbrush
- Defined in:
- lib/rspec_documentation/rspec/failure.rb
Overview
Stores information about a failed RSpec example. Thin wrapper around ‘RSpec::Failure`.
Instance Attribute Summary collapse
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
Instance Method Summary collapse
-
#initialize(cause:, spec:) ⇒ Failure
constructor
A new instance of Failure.
- #message ⇒ Object
Constructor Details
#initialize(cause:, spec:) ⇒ Failure
Returns a new instance of Failure.
11 12 13 14 |
# File 'lib/rspec_documentation/rspec/failure.rb', line 11 def initialize(cause:, spec:) @cause = cause @spec = spec end |
Instance Attribute Details
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
9 10 11 |
# File 'lib/rspec_documentation/rspec/failure.rb', line 9 def spec @spec end |
Instance Method Details
#message ⇒ Object
16 17 18 |
# File 'lib/rspec_documentation/rspec/failure.rb', line 16 def "\n#{formatted_header}\n\n#{formatted_source}\n\n#{formatted_cause}\n\n#{formatted_backtrace}\n\n" end |