summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_proc.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb
index 5436879041..c0a4e2268c 100644
--- a/test/ruby/test_proc.rb
+++ b/test/ruby/test_proc.rb
@@ -101,4 +101,11 @@ class TestProc < Test::Unit::TestCase
c.new.x(nil)
assert_equal(2, a, '[ruby-core:23050]')
end
+
+ def given_block(&b) b end
+ def test_return_from_proc
+ a_proc = eval("Proc.new { return }", TOPLEVEL_BINDING)
+ res = given_block(&a_proc)
+ assert_raise(LocalJumpError, '[ruby-core:24097]') {res.call}
+ end
end