class Test::Unit::Error
during the processing of a test.
Test::Unit::TestCase when it rescues an exception thrown
Encapsulates an error in a test. Created by
def critical?
def critical? true end
def initialize(test_name, exception, options={})
Creates a new Error with the given test_name and
def initialize(test_name, exception, options={}) @test_name = test_name @exception = exception @method_name = options[:method_name] end
def label
def label LABEL end
def location
def location @location ||= filter_backtrace(@exception.backtrace) end
def long_display
def long_display backtrace_display = location.join("\n ") "#{label}:\n#@test_name:\n#{message}\n #{backtrace_display}" end
def message
def message "#{@exception.class.name}: #{@exception.message}" end
def short_display
def short_display "#@test_name: #{message.split("\n")[0]}" end
def single_character_display
def single_character_display SINGLE_CHARACTER end
def to_s
def to_s long_display end