Skip to content

Instantly share code, notes, and snippets.

@phinze
Created August 19, 2009 14:22
Show Gist options
  • Save phinze/170369 to your computer and use it in GitHub Desktop.
Save phinze/170369 to your computer and use it in GitHub Desktop.
require 'spec/runner/formatter/specdoc_formatter'
class FindEvilExamplesFormatter < Spec::Runner::Formatter::SpecdocFormatter
def example_failed(*args)
warn_if_users_still_exist
super
end
def example_passed(*args)
warn_if_users_still_exist
super
end
private
def warn_if_users_still_exist
if User.count > 0
m = "OMFG Users exist in the system still! This is awful! #{User.all.map(&:login).join(',')}"
@output.puts red(m)
@output.flush
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment