Class: RSpec::Core::Notifications::PendingExampleFailedAsExpectedNotification

Inherits:
FailedExampleNotification show all
Defined in:
lib/rspec/core/notifications.rb

Overview

The PendingExampleFailedAsExpectedNotification extends FailedExampleNotification with things useful for pending specs that fail as expected.

See Also:

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from FailedExampleNotification

#colorized_formatted_backtrace, #colorized_message_lines, #description, #formatted_backtrace, #message_lines

Instance Attribute Details

- (RSpec::Core::Example) example

the current example

Returns:

334
335
336
# File 'lib/rspec/core/notifications.rb', line 334
def example
  @example
end

Instance Method Details

- (Exception) exception

Returns The exception that occurred while the pending example was executed

Returns:

  • (Exception)

    The exception that occurred while the pending example was executed

339
340
341
# File 'lib/rspec/core/notifications.rb', line 339
def exception
  example.execution_result.pending_exception
end

- (String) fully_formatted(pending_number, colorizer = ::RSpec::Core::Formatters::ConsoleCodes)

Returns The pending detail fully formatted in the way that RSpec's built-in formatters emit.

Returns:

  • (String)

    The pending detail fully formatted in the way that RSpec's built-in formatters emit.

345
346
347
# File 'lib/rspec/core/notifications.rb', line 345
def fully_formatted(pending_number, colorizer=::RSpec::Core::Formatters::ConsoleCodes)
  fully_formatted_header(pending_number, colorizer) << formatted_message_and_backtrace(colorizer)
end