Skip to content

Instantly share code, notes, and snippets.

@iamwilhelm
Created January 21, 2011 20:47
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 iamwilhelm/790386 to your computer and use it in GitHub Desktop.
Save iamwilhelm/790386 to your computer and use it in GitHub Desktop.
how unit test files automatically run
##
# 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