Skip to content

Instantly share code, notes, and snippets.

@cogumm
Created December 28, 2010 19:11
Show Gist options
  • Save cogumm/757570 to your computer and use it in GitHub Desktop.
Save cogumm/757570 to your computer and use it in GitHub Desktop.
monkey patched
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