class RSpec::Rerun::Formatter

Constants

FILENAME

Public Class Methods

new(_) click to toggle source
# File lib/rspec-rerun/formatter.rb, line 11
def initialize(_); end

Public Instance Methods

clean!() click to toggle source
# File lib/rspec-rerun/formatter.rb, line 22
def clean!
  File.delete FILENAME if File.exist? FILENAME
end
dump_failures(notification) click to toggle source
# File lib/rspec-rerun/formatter.rb, line 13
def dump_failures(notification)
  if notification.failed_examples.empty?
    clean!
  else
    rerun_commands = notification.failed_examples.map { |e| retry_command(e) }
    File.write(FILENAME, rerun_commands.join("\n"))
  end
end

Private Instance Methods

retry_command(example) click to toggle source
# File lib/rspec-rerun/formatter.rb, line 28
def retry_command(example)
  if example.respond_to?(:rerun_argument)
    example.rerun_argument
  else
    example.location.gsub("\"", "\\\"")
  end
end