summaryrefslogtreecommitdiff
path: root/test/ruby/test_exception.rb
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-31 14:01:54 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-31 14:01:54 +0000
commit607d93b92e374d4416ba189dd0d73ad51cdb924e (patch)
tree7675bb376da113b49771120b7e2c7f0e094b4ee5 /test/ruby/test_exception.rb
parent312de7a9ca97398994cb25b22242e4e348820f2a (diff)
merge revision(s) 63417: [Backport #14756]
error.c: check redefined backtrace result * error.c (rb_get_backtrace): check the result of `backtrace` even if the method is redefined. [ruby-core:87013] [Bug #14756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@64147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_exception.rb')
-rw-r--r--test/ruby/test_exception.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 8eb92faa08..b41ef87629 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -1066,5 +1066,14 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
raise RuntimeError, "hello"
}
end;
+
+ error_class = Class.new(StandardError) do
+ def backtrace; :backtrace; end
+ end
+ begin
+ raise error_class
+ rescue error_class => e
+ assert_raise(TypeError) {$@}
+ end
end
end