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.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 55f0d27c88..9de1b2d82c 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -518,6 +518,18 @@ end.join
end;
end
+ def test_backtrace_by_exception
+ begin
+ line = __LINE__; raise "foo"
+ rescue => e
+ end
+ e2 = e.exception("bar")
+ assert_not_equal(e.message, e2.message)
+ assert_equal(e.backtrace, e2.backtrace)
+ loc = e2.backtrace_locations[0]
+ assert_equal([__FILE__, line], [loc.path, loc.lineno])
+ end
+
Bug4438 = '[ruby-core:35364]'
def test_rescue_single_argument