Class: Test::Unit::TestResult

Inherits:
Object
  • Object
show all
Defined in:
lib/shoulda/color.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#old_to_sObject



25
# File 'lib/shoulda/color.rb', line 25

alias :old_to_s :to_s

#to_sObject



26
27
28
29
30
# File 'lib/shoulda/color.rb', line 26

def to_s
  if old_to_s =~ /\d+ tests, \d+ assertions, (\d+) failures, (\d+) errors/
    ThoughtBot::Shoulda::Color.send($1.to_i != 0 || $2.to_i != 0 ? :red : :green, $&)
  end
end