Class: RSpec::Core::Notifications::PendingExampleFixedNotification

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

Overview

The PendingExampleFixedNotification extends ExampleNotification with things useful for specs that pass when they are expected to fail.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from FailedExampleNotification

#colorized_formatted_backtrace, #exception, #formatted_backtrace, #fully_formatted

Instance Attribute Details

#exampleRSpec::Core::Example

the current example

Returns:



275
276
277
# File 'lib/rspec/core/notifications.rb', line 275

def example
  @example
end

Instance Method Details

#colorized_message_lines(colorizer = ::RSpec::Core::Formatters::ConsoleCodes) ⇒ Array(String)

Returns the message generated for this failure colorized line by line.

Parameters:

  • colorizer (#wrap) (defaults to: ::RSpec::Core::Formatters::ConsoleCodes)

    An object to colorize the message_lines by

Returns:

  • (Array(String))

    The example failure message colorized



296
297
298
# File 'lib/rspec/core/notifications.rb', line 296

def colorized_message_lines(colorizer=::RSpec::Core::Formatters::ConsoleCodes)
  message_lines.map { |line| colorizer.wrap(line, RSpec.configuration.fixed_color) }
end

#descriptionString

Returns the examples description.

Returns:

  • (String)

    The example description



281
282
283
# File 'lib/rspec/core/notifications.rb', line 281

def description
  "#{example.full_description} FIXED"
end

#message_linesArray(String)

Returns the message generated for this failure line by line.

Returns:

  • (Array(String))

    The example failure message



288
289
290
# File 'lib/rspec/core/notifications.rb', line 288

def message_lines
  ["Expected pending '#{example.execution_result.pending_message}' to fail. No Error was raised."]
end