class MiniTest::RG

def self.rg!

def self.rg!
  @rg = true
end

def self.rg?

def self.rg?
  @rg ||= false
end

def initialize io, colors = COLORS

def initialize io, colors = COLORS
  @io     = io
  @colors = colors
end

def method_missing msg, *args

def method_missing msg, *args
  return super unless io.respond_to? msg
  io.send(msg, *args)
end

def print o

def print o
  io.print(colors[o] || o)
end

def puts o=nil

def puts o=nil
  return io.puts if o.nil?
  if o =~ /(\d+) failures, (\d+) errors/
    if $1 != '0' || $2 != '0'
      io.puts "\e[31m#{o}\e[0m"
    else
      io.puts "\e[32m#{o}\e[0m"
    end
  else
    io.puts o
  end
end