Created
August 19, 2009 14:22
-
-
Save phinze/170369 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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