Encapsulates an error in a test. Created by Test::Unit::TestCase when it rescues an exception thrown during the processing of a test.
Creates a new Error with the given #test_name and exception.
# File test-unit-3.3.7/lib/test/unit/error.rb, line 26 def initialize(test_name, exception, options={}) @test_name = test_name @exception = exception @method_name = options[:method_name] end
# File test-unit-3.3.7/lib/test/unit/error.rb, line 67 def critical? true end
# File test-unit-3.3.7/lib/test/unit/error.rb, line 37 def label LABEL end
# File test-unit-3.3.7/lib/test/unit/error.rb, line 57 def location @location ||= filter_backtrace(@exception.backtrace) end
Returns a verbose version of the error description.
# File test-unit-3.3.7/lib/test/unit/error.rb, line 52 def long_display backtrace_display = location.join("\n ") "#{label}:\n#@test_name:\n#{message}\n #{backtrace_display}" end
Returns the message associated with the error.
# File test-unit-3.3.7/lib/test/unit/error.rb, line 42 def message "#{@exception.class.name}: #{@exception.message}" end
Returns a brief version of the error description.
# File test-unit-3.3.7/lib/test/unit/error.rb, line 47 def short_display "#@test_name: #{message.split("\n")[0]}" end