Class Spec::Runner::Reporter::Failure

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

Methods

public class

  1. new

public instance

  1. expectation_not_met?
  2. header
  3. pending_fixed?

protected instance

  1. example_name

Attributes

example [R]
exception [R]

Public class methods

new (group, example, exception)
[show source]
# File lib/spec/runner/reporter.rb, line 137
        def initialize(group, example, exception)
          @group, @example, @exception = group, example, exception
        end

Public instance methods

expectation_not_met? ()
[show source]
# File lib/spec/runner/reporter.rb, line 155
        def expectation_not_met?
          @exception.is_a?(Spec::Expectations::ExpectationNotMetError)
        end
header ()
[show source]
# File lib/spec/runner/reporter.rb, line 141
        def header
          if expectation_not_met?
            "'#{example_name}' FAILED"
          elsif pending_fixed?
            "'#{example_name}' FIXED"
          else
            "#{@exception.class.name} in '#{example_name}'"
          end
        end
pending_fixed? ()
[show source]
# File lib/spec/runner/reporter.rb, line 151
        def pending_fixed?
          @exception.is_a?(Spec::Example::PendingExampleFixedError)
        end

Protected instance methods

example_name ()
[show source]
# File lib/spec/runner/reporter.rb, line 161
        def example_name
          "#{@group} #{@example.description}"
        end