summaryrefslogtreecommitdiff
path: root/test/irb/test_raise_no_backtrace_exception.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-13 02:19:48 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-13 02:19:48 +0000
commitf741fd2d9d55afb535c3fd5635b2ee5252bedb68 (patch)
treef83840d19364ef8d0b25463783279380d298edbe /test/irb/test_raise_no_backtrace_exception.rb
parent087d1d27495b32b0af4acd4616354eab84b897d2 (diff)
* lib/irb.rb: Prevent irb from crashing when exception with
nil backtrace is raised. [fix GH-434][ruby-core:58078][Bug #9063] * test/irb/test_raise_no_backtrace_exception.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/irb/test_raise_no_backtrace_exception.rb')
-rw-r--r--test/irb/test_raise_no_backtrace_exception.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/irb/test_raise_no_backtrace_exception.rb b/test/irb/test_raise_no_backtrace_exception.rb
new file mode 100644
index 0000000..e8204d7
--- /dev/null
+++ b/test/irb/test_raise_no_backtrace_exception.rb
@@ -0,0 +1,14 @@
+require 'test/unit'
+require_relative '../ruby/envutil'
+
+module TestIRB
+ class TestRaiseNoBacktraceException < Test::Unit::TestCase
+ def test_raise_exception
+ status = assert_in_out_err(%w[-rirb -e IRB.start(__FILE__) -- -f --], <<-IRB, /Exception: foo/, [])
+ e = Exception.new("foo")
+ def e.backtrace; nil; end
+ raise e
+IRB
+ end
+ end
+end