Class: Spec::Runner::Reporter::Failure
- Defined in:
- lib/spec/runner/reporter.rb
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
Instance Method Summary collapse
- #expectation_not_met? ⇒ Boolean
- #header ⇒ Object
-
#initialize(example_name, exception) ⇒ Failure
constructor
A new instance of Failure.
- #pending_fixed? ⇒ Boolean
Constructor Details
#initialize(example_name, exception) ⇒ Failure
Returns a new instance of Failure.
99 100 101 102 |
# File 'lib/spec/runner/reporter.rb', line 99 def initialize(example_name, exception) @example_name = example_name @exception = exception end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
97 98 99 |
# File 'lib/spec/runner/reporter.rb', line 97 def exception @exception end |
Instance Method Details
#expectation_not_met? ⇒ Boolean
118 119 120 |
# File 'lib/spec/runner/reporter.rb', line 118 def expectation_not_met? @exception.is_a?(Spec::Expectations::ExpectationNotMetError) end |
#header ⇒ Object
104 105 106 107 108 109 110 111 112 |
# File 'lib/spec/runner/reporter.rb', line 104 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? ⇒ Boolean
114 115 116 |
# File 'lib/spec/runner/reporter.rb', line 114 def pending_fixed? @exception.is_a?(Spec::DSL::PendingFixedError) end |