From 912df4b615f30c5de468a3f214c86a1ec30cd22f Mon Sep 17 00:00:00 2001 From: nagachika Date: Thu, 28 Jun 2012 00:39:52 +0000 Subject: * class.c (class_instance_method_list): consider prepended Class/Module when recur != 0. [ruby-dev:45863] [Bug #6660] * test/ruby/test_module.rb (test_prepend_instance_methods_false): add a test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_module.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 0802048e10..8e3dbbc34f 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1327,4 +1327,10 @@ class TestModule < Test::Unit::TestCase class_eval(&block) if block end end + + def test_prepend_instance_methods_false + bug6660 = '[ruby-dev:45863]' + assert_equal([:m1], Class.new{ prepend Module.new; def m1; end }.instance_methods(false), bug6660) + assert_equal([:m1], Class.new(Class.new{def m2;end}){ prepend Module.new; def m1; end }.instance_methods(false), bug6660) + end end -- cgit v1.2.3