mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
47bd3ed9ce
#assert_block, and #flunk. * test/testunit/test_assertions.rb: ditto. * lib/test/unit/failure.rb: failures now show a better trace of where they occurred. * test/testunit/test_failure.rb: ditto (added). * lib/test/unit/testcase.rb: ditto. * test/testunit/test_testcase.rb: ditto. * lib/test/unit/util/backtracefilter.rb: added. * test/testunit/util/test_backtracefilter.rb: added. * lib/test/unit/error.rb: changed to use BacktraceFilter and improved output. * test/testunit/test_error.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
26 lines
644 B
Ruby
26 lines
644 B
Ruby
# Author:: Nathaniel Talbott.
|
|
# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
|
|
# License:: Ruby license.
|
|
|
|
require 'test/unit'
|
|
|
|
module Test
|
|
module Unit
|
|
class TC_Error < TestCase
|
|
TF_Exception = Struct.new('TF_Exception', :message, :backtrace)
|
|
def test_display
|
|
ex = TF_Exception.new("message1\nmessage2", ['line1', 'line2'])
|
|
e = Error.new("name", ex)
|
|
assert_equal("name: #{TF_Exception.name}: message1", e.short_display)
|
|
assert_equal(<<EOM.strip, e.long_display)
|
|
Error:
|
|
name:
|
|
Struct::TF_Exception: message1
|
|
message2
|
|
line1
|
|
line2
|
|
EOM
|
|
end
|
|
end
|
|
end
|
|
end
|