Class Spec::Runner::Reporter::Failure
In: lib/spec/runner/reporter.rb
Parent: Object

Methods

Attributes

exception  [R] 

Public Class methods

[Source]

    # File lib/spec/runner/reporter.rb, line 94
94:         def initialize(example_name, exception)
95:           @example_name = example_name
96:           @exception = exception
97:         end

Public Instance methods

[Source]

     # File lib/spec/runner/reporter.rb, line 107
107:         def expectation_not_met?
108:           @exception.is_a?(Spec::Expectations::ExpectationNotMetError)
109:         end

[Source]

     # File lib/spec/runner/reporter.rb, line 99
 99:         def header
100:           if expectation_not_met?
101:             "'#{@example_name}' FAILED"
102:           else
103:             "#{@exception.class.name} in '#{@example_name}'"
104:           end
105:         end

[Validate]