diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-13 06:13:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-13 06:13:08 +0000 |
commit | 99126a4c88d3ddb9ea76edf948307c7bfa0fe971 (patch) | |
tree | 1c472e98892cf684c6a7ed05a3e140f38eb2a07c /test | |
parent | be909b5e95e5ba56eadb42e6dbc9102c1188ae48 (diff) | |
download | ruby-99126a4c88d3ddb9ea76edf948307c7bfa0fe971.tar.gz |
class.c: from the origin class
* class.c (rb_obj_singleton_methods): collect methods from the origin
class. [ruby-core:53207] [Bug #8044]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_object.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb index 9787525bce..eab536b3d5 100644 --- a/test/ruby/test_object.rb +++ b/test/ruby/test_object.rb @@ -159,6 +159,15 @@ class TestObject < Test::Unit::TestCase assert_equal([:foo2], (o2.public_methods(false) - o0.public_methods(false)).sort) end + def test_methods_prepend + bug8044 = '[ruby-core:53207] [Bug #8044]' + o = Object.new + def o.foo; end + assert_equal([:foo], o.methods(false)) + class << o; prepend Module.new; end + assert_equal([:foo], o.methods(false), bug8044) + end + def test_instance_variable_get o = Object.new o.instance_eval { @foo = :foo } |