summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/t/exception.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/t/exception.rb b/test/t/exception.rb
index d43ce8833..5c15cdea0 100644
--- a/test/t/exception.rb
+++ b/test/t/exception.rb
@@ -315,6 +315,33 @@ assert('Exception 18') do
end == 3
end
+assert('Exception 19') do
+ class Class4Exception19
+ def a
+ r = @e = false
+ begin
+ b
+ rescue
+ r = self.z
+ end
+ [ r, @e ]
+ end
+
+ def b
+ begin
+ 1 * "b"
+ ensure
+ @e = self.z
+ end
+ end
+
+ def z
+ true
+ end
+ end
+ Class4Exception19.new.a == [true, true]
+end
+
assert('Exception#inspect without message') do
Exception.new.inspect
end