Skip to content

Instantly share code, notes, and snippets.

@danlucraft
Created January 12, 2009 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danlucraft/46057 to your computer and use it in GitHub Desktop.
Save danlucraft/46057 to your computer and use it in GitHub Desktop.
module Cucumber
module Formatters
class FailedFilesFormatter < ProgressFormatter
def initialize(step, _1, _2)
@bad_files = []
puts "Recording fails in bad_features"
@bad_files_io = File.open("bad_features", "w")
super(step)
end
def step_failed(step, regexp, args)
unless @bad_files.include? [step.file, step.line]
@bad_files << [step.file, step.line]
@bad_files_io.print step.file, ":", step.line, " "
@bad_files_io.flush
end
super
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment