1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_proc.rb (test_return_from_proc): test for [ruby-core:24097].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-07-01 07:09:53 +00:00
parent b8d684d9e2
commit 3948410b04

View file

@ -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