Class: RSpec::Core::Notifications::FailedExampleNotification
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
ExampleNotification ,
Struct
|
|
Instance Chain:
self,
ExampleNotification ,
Struct
|
|
Inherits: |
RSpec::Core::Notifications::ExampleNotification
|
Defined in: | rspec-core/lib/rspec/core/notifications.rb |
Overview
The FailedExampleNotification
extends ExampleNotification
with things useful for examples that have failure info – typically a failed or pending spec.
Class Method Summary
- .new(example, exception_presenter = Formatters::ExceptionPresenter::Factory.new(example).build) ⇒ FailedExampleNotification constructor private
ExampleNotification
- Inherited
Instance Attribute Summary
-
#example
rw
The
FailedExampleNotification
extendsExampleNotification
with things useful for examples that have failure info – typically a failed or pending spec.
ExampleNotification
- Inherited
#example | The |
Instance Method Summary
-
#colorized_formatted_backtrace(colorizer = ::RSpec::Core::Formatters::ConsoleCodes) ⇒ Array<String>
Returns the failures colorized formatted backtrace.
-
#colorized_message_lines(colorizer = ::RSpec::Core::Formatters::ConsoleCodes) ⇒ Array<String>
Returns the message generated for this failure colorized line by line.
- #description ⇒ String
- #exception ⇒ Exception
-
#formatted_backtrace ⇒ Array<String>
Returns the failures formatted backtrace.
- #fully_formatted(failure_number, colorizer = ::RSpec::Core::Formatters::ConsoleCodes) ⇒ String
- #fully_formatted_lines(failure_number, colorizer = ::RSpec::Core::Formatters::ConsoleCodes) ⇒ Array<string>
-
#message_lines ⇒ Array<String>
Returns the message generated for this failure line by line.
Constructor Details
.new(example, exception_presenter = Formatters::ExceptionPresenter::Factory.new(example).build) ⇒ FailedExampleNotification
(private)
# File 'rspec-core/lib/rspec/core/notifications.rb', line 213
def initialize(example, exception_presenter=Formatters::ExceptionPresenter::Factory.new(example).build) @exception_presenter = exception_presenter super(example) end
Instance Attribute Details
#example (rw)
The FailedExampleNotification
extends ExampleNotification
with things useful for examples that have failure info – typically a failed or pending spec.
# File 'rspec-core/lib/rspec/core/notifications.rb', line 156
class FailedExampleNotification < ExampleNotification public_class_method :new # @return [Exception] The example failure def exception @exception_presenter.exception end # @return [String] The example description def description @exception_presenter.description end # Returns the message generated for this failure line by line. # # @return [Array<String>] The example failure message def @exception_presenter. end # Returns the message generated for this failure colorized line by line. # # @param colorizer [#wrap] An object to colorize the message_lines by # @return [Array<String>] The example failure message colorized def (colorizer=::RSpec::Core::Formatters::ConsoleCodes)
Instance Method Details
#colorized_formatted_backtrace(colorizer = ::RSpec::Core::Formatters::ConsoleCodes) ⇒ Array
<String
>
Returns the failures colorized formatted backtrace.
# File 'rspec-core/lib/rspec/core/notifications.rb', line 195
def colorized_formatted_backtrace(colorizer=::RSpec::Core::Formatters::ConsoleCodes) @exception_presenter.colorized_formatted_backtrace(colorizer) end
#colorized_message_lines(colorizer = ::RSpec::Core::Formatters::ConsoleCodes) ⇒ Array
<String
>
Returns the message generated for this failure colorized line by line.
# File 'rspec-core/lib/rspec/core/notifications.rb', line 180
def (colorizer=::RSpec::Core::Formatters::ConsoleCodes) @exception_presenter. (colorizer) end
#description ⇒ String
# File 'rspec-core/lib/rspec/core/notifications.rb', line 165
def description @exception_presenter.description end
#exception ⇒ Exception
# File 'rspec-core/lib/rspec/core/notifications.rb', line 160
def exception @exception_presenter.exception end
#formatted_backtrace ⇒ Array
<String
>
Returns the failures formatted backtrace.
# File 'rspec-core/lib/rspec/core/notifications.rb', line 187
def formatted_backtrace @exception_presenter.formatted_backtrace end
#fully_formatted(failure_number, colorizer = ::RSpec::Core::Formatters::ConsoleCodes) ⇒ String
# File 'rspec-core/lib/rspec/core/notifications.rb', line 201
def fully_formatted(failure_number, colorizer=::RSpec::Core::Formatters::ConsoleCodes) @exception_presenter.fully_formatted(failure_number, colorizer) end
#fully_formatted_lines(failure_number, colorizer = ::RSpec::Core::Formatters::ConsoleCodes) ⇒ Array
<string
>
# File 'rspec-core/lib/rspec/core/notifications.rb', line 207
def fully_formatted_lines(failure_number, colorizer=::RSpec::Core::Formatters::ConsoleCodes) @exception_presenter.fully_formatted_lines(failure_number, colorizer) end
#message_lines ⇒ Array
<String
>
Returns the message generated for this failure line by line.
# File 'rspec-core/lib/rspec/core/notifications.rb', line 172
def @exception_presenter. end