Class: CI::Reporter::RSpec2Failure
- Inherits:
-
RSpecFailure
- Object
- RSpecFailure
- CI::Reporter::RSpec2Failure
- Defined in:
- lib/ci/reporter/rspec.rb
Instance Attribute Summary
Attributes inherited from RSpecFailure
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(example, formatter) ⇒ RSpec2Failure
constructor
A new instance of RSpec2Failure.
- #location ⇒ Object
- #message ⇒ Object
- #name ⇒ Object
Methods inherited from RSpecFailure
Constructor Details
#initialize(example, formatter) ⇒ RSpec2Failure
Returns a new instance of RSpec2Failure.
52 53 54 55 56 |
# File 'lib/ci/reporter/rspec.rb', line 52 def initialize(example, formatter) @formatter = formatter @example = example @exception = @example.execution_result[:exception] || @example.execution_result[:exception_encountered] end |
Instance Method Details
#failure? ⇒ Boolean
66 67 68 |
# File 'lib/ci/reporter/rspec.rb', line 66 def failure? exception.is_a?(::RSpec::Expectations::ExpectationNotMetError) end |
#location ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/ci/reporter/rspec.rb', line 70 def location output = [] output.push "#{exception.class.name << ":"}" unless exception.class.name =~ /RSpec/ output.push @exception. [@formatter.format_backtrace(@exception.backtrace, @example)].flatten.each do |backtrace_info| backtrace_info.lines.each do |line| output.push " #{line}" end end output.join "\n" end |
#message ⇒ Object
62 63 64 |
# File 'lib/ci/reporter/rspec.rb', line 62 def @exception. end |
#name ⇒ Object
58 59 60 |
# File 'lib/ci/reporter/rspec.rb', line 58 def name @exception.class.name end |