class GuardTestRunner
Thanks to Adam Sanderson for the really good starting point: endofline.wordpress.com/2008/02/11/a-custom-testrunner-to-scratch-an-itch/
This class inherits from Test::Unit’ standard console TestRunner I’m just overriding some callbacks methods to strip some outputs and display a notification on end
Public Class Methods
new(suite, options = {})
click to toggle source
Calls superclass method
# File lib/guard/test/guard_test_runner.rb, line 12 def initialize(suite, options = {}) super @color_scheme["pass"] = ::Test::Unit::Color.new("green", foreground: true, bold: true) @color_scheme["failure"] = ::Test::Unit::Color.new("red", foreground: true, bold: true) end
Protected Instance Methods
fault_color_name(fault)
click to toggle source
# File lib/guard/test/guard_test_runner.rb, line 31 def fault_color_name(fault) fault.class.name.split(/::/).last.downcase.to_sym end
finished(elapsed_time)
click to toggle source
Calls superclass method
# File lib/guard/test/guard_test_runner.rb, line 25 def finished(elapsed_time) super ::Guard::Test::Notifier.notify(@result, elapsed_time) nl end
setup_mediator()
click to toggle source
Test::Unit::UI::Console::TestRunner overrided methods
# File lib/guard/test/guard_test_runner.rb, line 21 def setup_mediator @mediator = ::Test::Unit::UI::TestRunnerMediator.new(@suite) end