Class: Test::Unit::Error

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

Instance Method Summary collapse

Instance Method Details

#long_displayObject



34
35
36
37
# File 'lib/unittest-colorizer.rb', line 34

def long_display
   backtrace = filter_backtrace(@exception.backtrace).join("\n    ")
   "Error:\n#{@test_name.green}:\n#{message}\n    #{backtrace}"
end

#messageObject



20
21
22
# File 'lib/unittest-colorizer.rb', line 20

def message
  "#{@exception.class.name.blue}: #{@exception.message.magenta}"
end

#plain_long_displayObject



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

alias_method :plain_long_display, :long_display

#plain_messageObject



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

alias_method :plain_message, :message

#plain_short_displayObject



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

alias_method :plain_short_display, :short_display

#plain_single_character_displayObject



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

alias_method :plain_single_character_display, :single_character_display

#short_displayObject



25
26
27
# File 'lib/unittest-colorizer.rb', line 25

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

#single_character_displayObject



15
16
17
# File 'lib/unittest-colorizer.rb', line 15

def single_character_display
  plain_single_character_display.white_on_red
end