blob: 57efdb2da5884bc8a745e0af672cc262d9778063 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
begin :shared
class ExceptionalClass
def initialize exception_to_throw = nil
raise exception_to_throw if exception_to_throw
end
end
end
def test_exception_in_newing_object args, assert
begin
ExceptionalClass.new TypeError
raise "Exception wasn't thrown!"
rescue Exception => e
assert.equal! e.class, TypeError, "Exceptions within constructor should be retained."
end
end
puts "running tests"
$gtk.reset 100
$gtk.log_level = :off
$gtk.tests.start
|