Method: Minitest::RG#puts

Defined in:
lib/maxitest/vendor/rg.rb

#puts(o = nil) ⇒ Object



75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/maxitest/vendor/rg.rb', line 75

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