summaryrefslogtreecommitdiff
path: root/test/ruby/test_exception.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_exception.rb')
-rw-r--r--test/ruby/test_exception.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 107d80b1a4..123eecc602 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -80,6 +80,28 @@ class TestException < Test::Unit::TestCase
assert(!bad)
end
+ def test_errinfo_in_debug
+ bug9568 = EnvUtil.labeled_class("[ruby-core:61091] [Bug #9568]", RuntimeError) do
+ def to_s
+ require '\0'
+ rescue LoadError
+ self.class.to_s
+ end
+ end
+
+ err = EnvUtil.verbose_warning do
+ assert_raise(bug9568) do
+ $DEBUG, debug = true, $DEBUG
+ begin
+ raise bug9568
+ ensure
+ $DEBUG = debug
+ end
+ end
+ end
+ assert_include(err, bug9568.to_s)
+ end
+
def test_break_ensure
bad = true
while true