Class: CI::Reporter::RSpec3::Failure
- Inherits:
-
Object
- Object
- CI::Reporter::RSpec3::Failure
- Defined in:
- lib/ci/reporter/rspec3/failure.rb
Instance Method Summary collapse
- #error? ⇒ Boolean
- #exception ⇒ Object
- #failure? ⇒ Boolean
-
#initialize(example) ⇒ Failure
constructor
A new instance of Failure.
- #location ⇒ Object
- #message ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(example) ⇒ Failure
Returns a new instance of Failure.
4 5 6 |
# File 'lib/ci/reporter/rspec3/failure.rb', line 4 def initialize(example) @example = example end |
Instance Method Details
#error? ⇒ Boolean
20 21 22 |
# File 'lib/ci/reporter/rspec3/failure.rb', line 20 def error? !failure? end |
#exception ⇒ Object
32 33 34 |
# File 'lib/ci/reporter/rspec3/failure.rb', line 32 def exception @example.exception end |
#failure? ⇒ Boolean
16 17 18 |
# File 'lib/ci/reporter/rspec3/failure.rb', line 16 def failure? exception.is_a?(::RSpec::Expectations::ExpectationNotMetError) end |
#location ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/ci/reporter/rspec3/failure.rb', line 24 def location output = [] output.push "#{name}:" unless name =~ /RSpec/ output.push output.push @example.formatted_backtrace output.join "\n" end |
#message ⇒ Object
12 13 14 |
# File 'lib/ci/reporter/rspec3/failure.rb', line 12 def exception. end |
#name ⇒ Object
8 9 10 |
# File 'lib/ci/reporter/rspec3/failure.rb', line 8 def name exception.class.name end |