diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-25 03:54:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-25 03:54:09 +0000 |
commit | d977cd4e0af5233a6de97f06ed143b2753d2e0e9 (patch) | |
tree | a31e83bf7242371882204e914a7498b5be402991 /test | |
parent | 58206933b48402709cf1a667b663e6285fa24d2d (diff) | |
download | ruby-d977cd4e0af5233a6de97f06ed143b2753d2e0e9.tar.gz |
proc.c: follow the original class
* proc.c (mnew_internal): follow the original class, not to loop
the prepended module. [ruby-core:77591] [Bug #12832]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_method.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index a87f46092d..83ad484238 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -885,6 +885,22 @@ class TestMethod < Test::Unit::TestCase assert_nil(m, Feature9781) end + def test_prepended_public_zsuper + mod = EnvUtil.labeled_module("Mod") {private def foo; :ok end} + mods = [mod] + obj = Object.new.extend(mod) + class << obj + public :foo + end + 2.times do |i| + mods.unshift(mod = EnvUtil.labeled_module("Mod#{i}") {def foo; end}) + obj.singleton_class.prepend(mod) + end + m = obj.method(:foo) + assert_equal(mods, mods.map {m.owner.tap {m = m.super_method}}) + assert_nil(m) + end + def rest_parameter(*rest) rest end |