aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_exception.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 22ac2aca1f..a44aef892b 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -379,6 +379,8 @@ end.join
assert_nothing_raised(NameError, bug5575) do
load(t.path)
end
+ ensure
+ t.close(true) if t
end
def test_equal
@@ -386,4 +388,21 @@ end.join
assert_equal(RuntimeError.new("a"), RuntimeError.new("a"), bug5865)
assert_not_equal(RuntimeError.new("a"), StandardError.new("a"), bug5865)
end
+
+ def test_exception_in_exception_equal
+ bug5865 = '[ruby-core:41979]'
+ t = Tempfile.new(["test_exception_in_exception_equal", ".rb"])
+ t.puts <<-EOC
+ o = Object.new
+ def o.exception(arg)
+ end
+ RuntimeError.new("a") == o
+ EOC
+ t.close
+ assert_nothing_raised(ArgumentError, bug5865) do
+ load(t.path)
+ end
+ ensure
+ t.close(true) if t
+ end
end