Class Spec::Runner::Reporter::Failure

  1. lib/spec/runner/reporter.rb
Parent: Object

Methods

public instance

  1. header

Attributes

exception [R] The Exception object raised

Public instance methods

header ()

Header messsage for reporting this failure, including the name of the example and an indicator of the type of failure. FAILED indicates a failed expectation. FIXED indicates a pending example that passes, and no longer needs to be pending. RuntimeError indicates that a RuntimeError occured.

Examples

'A new account should have a zero balance' FAILED
'A new account should have a zero balance' FIXED
RuntimeError in 'A new account should have a zero balance'
[show source]
# File lib/spec/runner/reporter.rb, line 89
        def header
          if expectation_not_met?
            "'#{@example_name}' FAILED"
          elsif pending_fixed?
            "'#{@example_name}' FIXED"
          else
            "#{@exception.class.name} in '#{@example_name}'"
          end
        end