2003-09-18 22:48:46 -04:00
|
|
|
# Author:: Nathaniel Talbott.
|
|
|
|
# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
|
|
|
|
# License:: Ruby license.
|
|
|
|
|
2003-10-02 19:03:13 -04:00
|
|
|
require 'test/unit'
|
2003-09-18 22:48:46 -04:00
|
|
|
|
|
|
|
module Test
|
|
|
|
module Unit
|
|
|
|
class TC_Error < TestCase
|
2003-10-02 19:03:13 -04:00
|
|
|
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
|
2003-09-18 22:48:46 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|