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.
57 58 59 60 61 62 63 64 65 |
# File 'lib/ci/reporter/rspec.rb', line 57 def initialize(example, formatter) @formatter = formatter @example = example if @example.respond_to?(:execution_result) @exception = @example.execution_result[:exception] || @example.execution_result[:exception_encountered] else @exception = @example.[:execution_result][:exception] end end |
Instance Method Details
#failure? ⇒ Boolean
75 76 77 |
# File 'lib/ci/reporter/rspec.rb', line 75 def failure? exception.is_a?(::RSpec::Expectations::ExpectationNotMetError) end |
#location ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/ci/reporter/rspec.rb', line 79 def location output = [] output.push "#{exception.class.name << ":"}" unless exception.class.name =~ /RSpec/ output.push @exception. = RSpecFormatters::RSpec_2_12_0_bug ? @example. : @example [@formatter.format_backtrace(@exception.backtrace, )].flatten.each do |backtrace_info| backtrace_info.lines.each do |line| output.push " #{line}" end end output.join "\n" end |
#message ⇒ Object
71 72 73 |
# File 'lib/ci/reporter/rspec.rb', line 71 def @exception. end |
#name ⇒ Object
67 68 69 |
# File 'lib/ci/reporter/rspec.rb', line 67 def name @exception.class.name end |