Class: Spec::Runner::Reporter::Failure
- Defined in:
- lib/gems/rspec-1.1.12/lib/spec/runner/reporter.rb
Instance Attribute Summary collapse
-
#example ⇒ Object
readonly
Returns the value of attribute example.
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
Instance Method Summary collapse
- #expectation_not_met? ⇒ Boolean
- #header ⇒ Object
-
#initialize(example, exception) ⇒ Failure
constructor
A new instance of Failure.
- #pending_fixed? ⇒ Boolean
Constructor Details
#initialize(example, exception) ⇒ Failure
Returns a new instance of Failure.
137 138 139 140 |
# File 'lib/gems/rspec-1.1.12/lib/spec/runner/reporter.rb', line 137 def initialize(example, exception) @example = example @exception = exception end |
Instance Attribute Details
#example ⇒ Object (readonly)
Returns the value of attribute example.
135 136 137 |
# File 'lib/gems/rspec-1.1.12/lib/spec/runner/reporter.rb', line 135 def example @example end |
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
135 136 137 |
# File 'lib/gems/rspec-1.1.12/lib/spec/runner/reporter.rb', line 135 def exception @exception end |
Instance Method Details
#expectation_not_met? ⇒ Boolean
156 157 158 |
# File 'lib/gems/rspec-1.1.12/lib/spec/runner/reporter.rb', line 156 def expectation_not_met? @exception.is_a?(Spec::Expectations::ExpectationNotMetError) end |
#header ⇒ Object
142 143 144 145 146 147 148 149 150 |
# File 'lib/gems/rspec-1.1.12/lib/spec/runner/reporter.rb', line 142 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
152 153 154 |
# File 'lib/gems/rspec-1.1.12/lib/spec/runner/reporter.rb', line 152 def pending_fixed? @exception.is_a?(Spec::Example::PendingExampleFixedError) end |