summaryrefslogtreecommitdiff
path: root/test/ruby/test_module.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-27 13:40:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-27 13:40:37 +0000
commit3e96f56f8ae9cb428e00aa0d60ddd18304a1f09e (patch)
tree84fa06ec741e229627b85f82420c87e8e08a05df /test/ruby/test_module.rb
parentd4269d7b7c5c89b98c3f920dcadde1a635f5d72d (diff)
remove from original m_tbl
* vm_method.c (remove_method): remove the method from the original m_tbl on a prepended module. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r--test/ruby/test_module.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index aa48e1793c..d7a6248909 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -1290,4 +1290,13 @@ class TestModule < Test::Unit::TestCase
o.singleton_class.class_eval {prepend Module.new}
assert_equal([], o.singleton_methods)
end
+
+ def test_prepend_remove_method
+ assert_raise(NameError) do
+ Class.new do
+ prepend Module.new {def foo; end}
+ remove_method(:foo)
+ end
+ end
+ end
end