Created
January 6, 2010 07:39
-
-
Save fujimura/270112 to your computer and use it in GitHub Desktop.
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
require 'test/unit' | |
require 'test/unit/ui/testrunnermediator' | |
require 'test/unit/ui/testrunnerutilities' | |
require 'rubygems' | |
require 'redgreen' | |
module Test::Unit | |
class TestCase | |
def name | |
if (defined? Shoulda) && (self.class.include? Shoulda::InstanceMethods) | |
@method_name.gsub /test: /,"" | |
else | |
@method_name | |
end | |
end | |
end | |
class Failure | |
def expectation_display | |
Color.red "F " + @test_name | |
end | |
end | |
class Error | |
def expectation_display | |
Color.yellow "E " + @test_name | |
end | |
end | |
module UI | |
module Console | |
class TestRunner | |
extend TestRunnerUtilities | |
def add_fault(fault) | |
@faults << fault | |
output(fault.expectation_display, PROGRESS_ONLY) | |
@already_outputted = true | |
end | |
def test_finished(name) | |
output(Color.green(". " + name), PROGRESS_ONLY) unless (@already_outputted) | |
nl(VERBOSE) | |
@already_outputted = false | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment