Class: RSpec::Core::Notifications::FailedExampleNotification
- Inherits:
-
ExampleNotification
- Object
- Struct
- ExampleNotification
- RSpec::Core::Notifications::FailedExampleNotification
- Defined in:
- lib/rspec/core/notifications.rb
Overview
The FailedExampleNotification
extends ExampleNotification
with
things useful for failed specs.
Direct Known Subclasses
PendingExampleFailedAsExpectedNotification, PendingExampleFixedNotification
Instance Attribute Summary (collapse)
-
- (RSpec::Core::Example) example
the current example.
Instance Method Summary (collapse)
-
- (Array<String>) colorized_formatted_backtrace(colorizer = ::RSpec::Core::Formatters::ConsoleCodes)
Returns the failures colorized formatted backtrace.
-
- (Array<String>) colorized_message_lines(colorizer = ::RSpec::Core::Formatters::ConsoleCodes)
Returns the message generated for this failure colorized line by line.
-
- (String) description
The example description.
-
- (Exception) exception
The example failure.
-
- (Array<String>) formatted_backtrace
Returns the failures formatted backtrace.
-
- (String) fully_formatted(failure_number, colorizer = ::RSpec::Core::Formatters::ConsoleCodes)
The failure information fully formatted in the way that RSpec's built-in formatters emit.
-
- (Array<String>) message_lines
Returns the message generated for this failure line by line.
Instance Attribute Details
- (RSpec::Core::Example) example
the current example
149 150 151 |
# File 'lib/rspec/core/notifications.rb', line 149 def example @example end |
Instance Method Details
- (Array<String>) colorized_formatted_backtrace(colorizer = ::RSpec::Core::Formatters::ConsoleCodes)
Returns the failures colorized formatted backtrace.
190 191 192 193 194 |
# File 'lib/rspec/core/notifications.rb', line 190 def colorized_formatted_backtrace(colorizer=::RSpec::Core::Formatters::ConsoleCodes) formatted_backtrace.map do |backtrace_info| colorizer.wrap "# #{backtrace_info}", RSpec.configuration.detail_color end end |
- (Array<String>) colorized_message_lines(colorizer = ::RSpec::Core::Formatters::ConsoleCodes)
Returns the message generated for this failure colorized line by line.
173 174 175 176 177 |
# File 'lib/rspec/core/notifications.rb', line 173 def (colorizer=::RSpec::Core::Formatters::ConsoleCodes) add_shared_group_lines(failure_lines, colorizer).map do |line| colorizer.wrap line, end end |
- (String) description
Returns The example description
158 159 160 |
# File 'lib/rspec/core/notifications.rb', line 158 def description example.full_description end |
- (Exception) exception
Returns The example failure
153 154 155 |
# File 'lib/rspec/core/notifications.rb', line 153 def exception example.execution_result.exception end |
- (Array<String>) formatted_backtrace
Returns the failures formatted backtrace.
182 183 184 |
# File 'lib/rspec/core/notifications.rb', line 182 def formatted_backtrace backtrace_formatter.format_backtrace(exception.backtrace, example.) end |
- (String) fully_formatted(failure_number, colorizer = ::RSpec::Core::Formatters::ConsoleCodes)
Returns The failure information fully formatted in the way that RSpec's built-in formatters emit.
198 199 200 |
# File 'lib/rspec/core/notifications.rb', line 198 def fully_formatted(failure_number, colorizer=::RSpec::Core::Formatters::ConsoleCodes) "\n #{failure_number}) #{description}\n#{(colorizer)}" end |
- (Array<String>) message_lines
Returns the message generated for this failure line by line.
165 166 167 |
# File 'lib/rspec/core/notifications.rb', line 165 def add_shared_group_lines(failure_lines, NullColorizer) end |