Skip to content

Instantly share code, notes, and snippets.

@ecerulm
Created February 27, 2012 22:43
Show Gist options
  • Save ecerulm/1927651 to your computer and use it in GitHub Desktop.
Save ecerulm/1927651 to your computer and use it in GitHub Desktop.
custom testrunner
# Usage:
# ruby -rstat_runner [test] --runner=stat
# http://endofline.wordpress.com/2008/02/11/a-custom-testrunner-to-scratch-an-itch/require 'test/unit'
require 'test/unit/ui/console/testrunner'
class StatRunner < Test::Unit::UI::Console::TestRunner
def finished(elapsed_time)
nl
output("="*72)
output("|"+"Finished in #{elapsed_time} seconds.".center(70)+"|")
output("="*72)
nl
output(@result)
end
end
Test::Unit::AutoRunner::RUNNERS[:stat] = proc do |r|
StatRunner
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment