Created
December 28, 2010 19:11
-
-
Save cogumm/757570 to your computer and use it in GitHub Desktop.
monkey patched
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
class Test::Unit::UI::Console::RedGreenTestRunner < Test::Unit::UI::Console::TestRunner | |
def initialize(suite, output_level=NORMAL, io=$stdout) | |
# monkey patched passando os parametros suite, output_level | |
super(suite, output_level) | |
# monkey patched @io = io | |
@io = io | |
end | |
# monkey patched adicionado o parametro color=nil | |
def output_single(something, color=nil, level=NORMAL) | |
return unless (output?(level)) | |
something = case something | |
when '.' then Color.green('.') | |
when 'F' then Color.red("F") | |
when 'E' then Color.yellow("E") | |
else something | |
end | |
@io.write(something) | |
@io.flush | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment