From 010a742cb6772d4a27d5fee3606ac9385ca246e0 Mon Sep 17 00:00:00 2001 From: mame Date: Fri, 21 Dec 2018 11:44:21 +0000 Subject: eval_error.c (show_cause): check if cause is an Exception or not Fixes [Bug #15447] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_exception.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby/test_exception.rb') diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 3582cb3de3..88bd095228 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1341,6 +1341,15 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| assert_in_out_err([], code, [], /Bug14566/, success: false, timeout: 2) end + def test_non_exception_cause + puts "foo" + code = "#{<<~"begin;"}\n#{<<~'end;'}" + begin; + raise "foo", cause: 1 + end; + assert_in_out_err([], code, [], /foo/, success: false, timeout: 2) + end + def test_super_in_method_missing assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") begin; -- cgit v1.2.3