CI::Reporter::RSpec2Failure

Public Class Methods

new(example, formatter) click to toggle source
# 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.metadata[:execution_result][:exception]
  end
end

Public Instance Methods

failure?() click to toggle source
# File lib/ci/reporter/rspec.rb, line 75
def failure?
  exception.is_a?(::RSpec::Expectations::ExpectationNotMetError)
end
location() click to toggle source
# File lib/ci/reporter/rspec.rb, line 79
def location
  output = []
  output.push "#{exception.class.name << ":"}" unless exception.class.name =~ /RSpec/
  output.push @exception.message

  format_metadata = RSpecFormatters::RSpec_2_12_0_bug ? @example.metadata : @example

  [@formatter.format_backtrace(@exception.backtrace, format_metadata)].flatten.each do |backtrace_info|
    backtrace_info.lines.each do |line|
      output.push "     #{line}"
    end
  end
  output.join "\n"
end
message() click to toggle source
# File lib/ci/reporter/rspec.rb, line 71
def message
  @exception.message
end
name() click to toggle source
# File lib/ci/reporter/rspec.rb, line 67
def name
  @exception.class.name
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.