Created
January 21, 2011 20:47
-
-
Save iamwilhelm/790386 to your computer and use it in GitHub Desktop.
how unit test files automatically run
This file contains 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
## | |
# Registers MiniTest::Unit to run tests at process exit | |
def self.autorun | |
at_exit { | |
next if $! # don't run if there was an exception | |
exit_code = MiniTest::Unit.new.run(ARGV) | |
exit false if exit_code && exit_code != 0 | |
} unless @@installed_at_exit | |
@@installed_at_exit = true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment