summaryrefslogtreecommitdiff
path: root/test/ruby/test_object.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_object.rb')
-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 }