# File lib/rspec-rerun/formatter.rb, line 11 def initialize(_); end
# File lib/rspec-rerun/formatter.rb, line 22 def clean! File.delete FILENAME if File.exist? FILENAME end
# 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
# 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