summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-18 14:22:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-18 14:22:15 +0000
commit49455d6cdcc6430368e1722806f2c3af9cc6eba2 (patch)
treebb89cfc7f7257d2c9413c76663fd132dd8bce2dd /test
parentadb3f250fe5a7c50872436c1b6c25627e850f981 (diff)
vm_args.c: pass block
* vm_args.c (refine_sym_proc_call): pass block to the method when using refinements. [ruby-core:80219] [Bug #13325] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_refinement.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index a178f24591..f6e08729d7 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -1769,6 +1769,31 @@ class TestRefinement < Test::Unit::TestCase
assert_equal("Foo#x", FooExtClient.return_proc(&:x).(Foo.new))
end
+ def test_symbol_proc_with_block
+ assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
+ bug = '[ruby-core:80219] [Bug #13325]'
+ begin;
+ module M
+ refine Class.new do
+ end
+ end
+ class C
+ def call(a, x, &b)
+ b.call(a, &x)
+ end
+ end
+ o = C.new
+ r = nil
+ x = ->(z){r = z}
+ assert_equal(42, o.call(42, x, &:tap))
+ assert_equal(42, r)
+ using M
+ r = nil
+ assert_equal(42, o.call(42, x, &:tap), bug)
+ assert_equal(42, r, bug)
+ end;
+ end
+
module AliasInSubclass
class C
def foo