diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-09 14:04:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-09 14:04:21 +0000 |
commit | 140f8b94ced86966fc6979e8cfc5ef3bfa68da5d (patch) | |
tree | 307ec78c0a30d97a4049492f867ecab61d02dba2 /test/ruby/test_object.rb | |
parent | 347f3f30d6743e8b7cd133ae298c0290f2ef3a1d (diff) |
class.c: refactor class_instance_method_list
* class.c (class_instance_method_list): gather singleton and
extended methods first separately from ancestors.
[ruby-core:90872] [Bug #15501]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_object.rb')
-rw-r--r-- | test/ruby/test_object.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb index 0d31eb3ff0..277995b323 100644 --- a/test/ruby/test_object.rb +++ b/test/ruby/test_object.rb @@ -227,6 +227,14 @@ class TestObject < Test::Unit::TestCase assert_equal([:foo], o.methods(false), bug8044) end + def test_methods_prepend_singleton + c = Class.new(Module) {private def foo; end} + k = c.new + k.singleton_class + c.module_eval {prepend(Module.new)} + assert_equal([:foo], k.private_methods(false)) + end + def test_instance_variable_get o = Object.new o.instance_eval { @foo = :foo } |