summaryrefslogtreecommitdiffhomepage
path: root/test/t/module.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-04-08 12:11:18 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2013-04-08 12:11:18 -0700
commit87cd4c5ecc69208018c4d9deea63d566974561dd (patch)
tree91e914936c38b23d35f4f7bc4694c78036a54363 /test/t/module.rb
parent1b40c057f56ffa87abc7c5db467c91981db610f8 (diff)
parent91db2904124c66ee44499a6f93ceb2e56a99642c (diff)
downloadmruby-87cd4c5ecc69208018c4d9deea63d566974561dd.tar.gz
mruby-87cd4c5ecc69208018c4d9deea63d566974561dd.zip
Merge pull request #1144 from monaka/pr-add-iso-conformance-tests-20130406
Add more ISO conformance tests.
Diffstat (limited to 'test/t/module.rb')
-rw-r--r--test/t/module.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/t/module.rb b/test/t/module.rb
index 1ff9d3aea..4b689ea5b 100644
--- a/test/t/module.rb
+++ b/test/t/module.rb
@@ -297,6 +297,29 @@ assert('Module#remove_method', '15.2.2.4.41') do
not Test4RemoveMethod::Child.instance_methods(false).include? :hello
end
+assert('Module.undef_method', '15.2.2.4.42') do
+ module Test4UndefMethod
+ class Parent
+ def hello
+ end
+ end
+
+ class Child < Parent
+ def hello
+ end
+ end
+
+ class GrandChild < Child
+ end
+ end
+
+ Test4UndefMethod::Child.class_eval{ undef_method :hello }
+
+ Test4UndefMethod::Parent.new.respond_to?(:hello) and
+ not Test4UndefMethod::Child.new.respond_to?(:hello) and
+ not Test4UndefMethod::GrandChild.new.respond_to?(:hello)
+end
+
# Not ISO specified