Method: AnySpec::TestRunner#message

Defined in:
lib/any-spec/test-runner.rb

#message(string, color = :white) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/any-spec/test-runner.rb', line 58

def message(string, color = :white)
  if(@silence)
    @report << string
  else
    case color
      when :white then print( "\e[37m" )
      when :red then print( "\e[31m" )
      when :green then print( "\e[32m" )
      when :grey then print( "\e[90m")
    end
    print string + "\e[0m"
    $stdout.flush
  end
end