aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_refinement.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-24 04:36:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-24 04:36:00 +0000
commitac94eb1a9116858396998b4b93122bef942f5378 (patch)
tree591ad16f4fc583792462899d0e9bd482fa086d52 /test/ruby/test_refinement.rb
parentbd88e6c0b5f01ebdd2d758bd86845eb44605d4f0 (diff)
downloadruby-ac94eb1a9116858396998b4b93122bef942f5378.tar.gz
vm_insnhelper.c: compare with me in method top cfp
* vm_insnhelper.c (vm_call_method): block level control frame does not have method entry, so obtain the method entry from method top-level control frame to be compared with refined method entry. [ruby-core:52750] [Bug #7925] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_refinement.rb')
-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 555538c3a1..23b73667a7 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -801,6 +801,31 @@ class TestRefinement < Test::Unit::TestCase
assert_equal("mixin", TestRefinement::PrependAfterRefine::C.new.bar)
end
+ module SuperInBlock
+ class C
+ def foo(*args)
+ [:foo, *args]
+ end
+ end
+
+ module R
+ refine C do
+ def foo(*args)
+ tap do
+ return super(:ref, *args)
+ end
+ end
+ end
+ end
+ end
+
+ def test_super_in_block
+ bug7925 = '[ruby-core:52750] [Bug #7925]'
+ x = eval_using(SuperInBlock::R,
+ "TestRefinement:: SuperInBlock::C.new.foo(#{bug7925.dump})")
+ assert_equal([:foo, :ref, bug7925], x, bug7925)
+ end
+
private
def eval_using(mod, s)