From 9f1fb0a17febc59356d58cef5e98db61a3c03550 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 10 Jan 2019 08:19:14 +0000 Subject: proc.c: proc without block * proc.c (proc_new): promoted lambda/proc/Proc.new with no block in a method called with a block to a warning/error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_proc.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index 4abe0aa1bb..10ae02849d 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -424,14 +424,14 @@ class TestProc < Test::Unit::TestCase 1.times { b = lambda } b end - assert_equal(:foo, o.foo { :foo }.call) + assert_raise(ArgumentError) {o.foo { :foo }.call} def o.foo(&b) b = nil 1.times { b = lambda } b end - assert_equal(:foo, o.foo { :foo }.call) + assert_raise(ArgumentError) {o.foo { :foo }.call} end def test_arity2 -- cgit v1.2.3