Class: Test::Unit::Failure

Inherits:
Object
  • Object
show all
Defined in:
lib/unittest-colorizer.rb

Instance Method Summary collapse

Instance Method Details

#long_displayObject



57
58
59
60
61
62
63
64
# File 'lib/unittest-colorizer.rb', line 57

def long_display
  location_display = if(location.size == 1)
    location[0].sub(/\A(.+:\d+).*/, ' [\\1]')
  else
    "\n    [#{location.join("\n     ")}]"
  end
  "Failure:\n#{@test_name.green}#{location_display}:\n#@message"
end

#plain_long_displayObject



56
# File 'lib/unittest-colorizer.rb', line 56

alias_method :plain_long_display, :long_display

#plain_short_displayObject



51
# File 'lib/unittest-colorizer.rb', line 51

alias_method :plain_short_display, :short_display

#plain_single_character_displayObject



46
# File 'lib/unittest-colorizer.rb', line 46

alias_method :plain_single_character_display, :single_character_display

#short_displayObject



52
53
54
# File 'lib/unittest-colorizer.rb', line 52

def short_display
  "#{@test_name.green}: #{@message.split("\n")[0].magenta}"
end

#single_character_displayObject



47
48
49
# File 'lib/unittest-colorizer.rb', line 47

def single_character_display
  plain_single_character_display.red
end