From fe38109ffe721dda8024214c246fa8af4e6c3d78 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Tue, 23 Oct 2012 17:46:33 +0000 Subject: Add test for instance_exec receiving a curried proc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_proc.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby/test_proc.rb') diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index 909b42cb8d..b2ce8bcf62 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -261,6 +261,15 @@ class TestProc < Test::Unit::TestCase end, 'moved from btest/knownbug, [ruby-core:15551]') end + def test_curry_instance_exec + a = lambda { |x, y| [x + y, self] } + b = a.curry.call(1) + result = instance_exec 2, &b + + assert_equal(3, result[0]) + assert_equal(self, result[1]) + end + def test_dup_clone b = proc {|x| x + "bar" } class << b; attr_accessor :foo; end -- cgit v1.2.3