summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-23 17:46:33 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-23 17:46:33 +0000
commitfe38109ffe721dda8024214c246fa8af4e6c3d78 (patch)
treea36739bba4987a7116c1323d43f92024eb2604a8 /test
parenta8e25c92f36cd4c03d0db16fe93f3b8cf205edb3 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_proc.rb9
1 files changed, 9 insertions, 0 deletions
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