Method: RSpec::Core::Notifications::SummaryNotification#colorized_rerun_commands

Defined in:
lib/rspec/core/notifications.rb

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

Formats failures into a rerunable command format.

Parameters:

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

    An object which supports wrapping text with specific colors.

Returns:

  • (String)

    A colorized summary line.

[View source]

364
365
366
367
368
369
370
# File 'lib/rspec/core/notifications.rb', line 364

def colorized_rerun_commands(colorizer=::RSpec::Core::Formatters::ConsoleCodes)
  "\nFailed examples:\n\n" +
  failed_examples.map do |example|
    colorizer.wrap("rspec #{rerun_argument_for(example)}", RSpec.configuration.failure_color) + " " +
    colorizer.wrap("# #{example.full_description}",   RSpec.configuration.detail_color)
  end.join("\n")
end