aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-09 14:04:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-09 14:04:21 +0000
commit140f8b94ced86966fc6979e8cfc5ef3bfa68da5d (patch)
tree307ec78c0a30d97a4049492f867ecab61d02dba2 /test
parent347f3f30d6743e8b7cd133ae298c0290f2ef3a1d (diff)
downloadruby-140f8b94ced86966fc6979e8cfc5ef3bfa68da5d.tar.gz
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')
-rw-r--r--test/ruby/test_object.rb8
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 }