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(context_name, spec_name, exception) ⇒ Failure
constructor
A new instance of Failure.
Constructor Details
#initialize(context_name, spec_name, exception) ⇒ Failure
Returns a new instance of Failure.
84 85 86 87 88 |
# File 'lib/spec/runner/reporter.rb', line 84 def initialize(context_name, spec_name, exception) @context_name = context_name @spec_name = spec_name @exception = exception end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
82 83 84 |
# File 'lib/spec/runner/reporter.rb', line 82 def exception @exception end |
Instance Method Details
#expectation_not_met? ⇒ Boolean
98 99 100 |
# File 'lib/spec/runner/reporter.rb', line 98 def expectation_not_met? @exception.is_a?(Spec::Expectations::ExpectationNotMetError) end |
#header ⇒ Object
90 91 92 93 94 95 96 |
# File 'lib/spec/runner/reporter.rb', line 90 def header if expectation_not_met? "'#{@context_name} #{@spec_name}' FAILED" else "#{@exception.class.name} in '#{@context_name} #{@spec_name}'" end end |