1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib/minitest/pride.rb
ryan d264d3cc38 Imported minitest 2.0.0 r5952. Fixed test/unit.rb to work with changes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-01 05:33:32 +00:00

41 lines
880 B
Ruby

############################################################
# This file is imported from a different project.
# DO NOT make modifications in this repo.
# File a patch instead and assign it to Ryan Davis
############################################################
require "minitest/unit"
##
# Show your testing pride!
class PrideIO
attr_reader :io
# stolen from /System/Library/Perl/5.10.0/Term/ANSIColor.pm
COLORS = (31..36).to_a
CHARS = ["*"]
def initialize io
@io = io
@colors = COLORS.cycle
@chars = CHARS.cycle
end
def print o
case o
when "." then
io.print "\e[#{@colors.next}m#{@chars.next}\e[0m"
when "E", "F" then
io.print "\e[41m\e[37m#{o}\e[0m"
else
io.print o
end
end
def method_missing msg, *args
io.send(msg, *args)
end
end
MiniTest::Unit.output = PrideIO.new(MiniTest::Unit.output)