aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-07 18:59:38 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-07 18:59:38 +0000
commit01c201080383e42c95b2d5780e2df72916dc7476 (patch)
tree58f7c1aac414fceb00a3d5bdc1f003406d610c9c /test
parentd9c0993f2d0c909c55cbae35eef0f053620ae506 (diff)
downloadruby-01c201080383e42c95b2d5780e2df72916dc7476.tar.gz
* vm_args.c (setup_parameters_complex): don't raise ArgumentError
if an array is given for instance_exec with optional argument. [ruby-core:76300] [Bug #12568] https://github.com/rails/rails/pull/25699 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_lambda.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_lambda.rb b/test/ruby/test_lambda.rb
index efc3d0f2ca..c65169ac27 100644
--- a/test/ruby/test_lambda.rb
+++ b/test/ruby/test_lambda.rb
@@ -72,6 +72,13 @@ class TestLambdaParameters < Test::Unit::TestCase
assert_raise(ArgumentError, bug9605) {proc(&plus).call [1,2]}
end
+ def test_instance_exec
+ bug12568 = '[ruby-core:76300] [Bug #12568]'
+ assert_nothing_raised(ArgumentError, bug12568) do
+ instance_exec([1,2,3], &->(a=[]){ a })
+ end
+ end
+
def yield_1(arg)
yield arg
end