diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-27 12:31:17 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-27 12:31:17 +0000 |
commit | cf3a8f09b806dc6f31363e845d9e93d5e046af91 (patch) | |
tree | ee53fb2bf706675f383362bd386f6eeab1ae42f3 /test | |
parent | 48c04ad0d82ec4339ffd12ad4717b4dbde2aa74f (diff) | |
download | ruby-cf3a8f09b806dc6f31363e845d9e93d5e046af91.tar.gz |
ancestor modules
* class.c (rb_prepend_module): ancestors of prepending module also
should be included. [ruby-core:45914][Bug #6654]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_module.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 5826ed0269..7f66911e43 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1271,6 +1271,15 @@ class TestModule < Test::Unit::TestCase assert_equal(expected, obj.m1) end + def test_prepend_inheritance + bug6654 = '[ruby-core:45914]' + a = Module.new + b = Module.new {include a} + c = Class.new {prepend b} + assert_operator(c, :<, b, bug6654) + assert_operator(c, :<, a, bug6654) + end + def test_prepend_instance_methods bug6655 = '[ruby-core:45915]' assert_equal(Object.instance_methods, Class.new {prepend Module.new}.instance_methods, bug6655) |