diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-08 05:16:33 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-08 05:16:33 +0000 |
commit | 7bbab207cbe0c92777fcb30e21cde787ca9a3863 (patch) | |
tree | 1d486994c917fa7f90c71c525689fd5f02479683 /test/ruby | |
parent | 510f0ec86912e31babaadf1f66bf2a82351c1359 (diff) | |
download | ruby-7bbab207cbe0c92777fcb30e21cde787ca9a3863.tar.gz |
vm_insnhelper.c: zsuper in refinements
* vm_insnhelper.c (vm_call_zsuper): prevent infinite recursion
zsuper in refinements. [ruby-core:77161] [Bug #12729]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_refinement.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 6c32be5e61..8af9945080 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -1789,6 +1789,27 @@ class TestRefinement < Test::Unit::TestCase end; end + def test_public_in_refine + assert_separately([], "#{<<-"begin;"}\n#{<<-"end;"}") + begin; + bug12729 = '[ruby-core:77161] [Bug #12729]' + + class Cow + private + def moo() "Moo"; end + end + + module PublicCows + refine(Cow) { + public :moo + } + end + + using PublicCows + assert_equal("Moo", Cow.new.moo, bug12729) + end; + end + private def eval_using(mod, s) |