From d1b131e2b085e180fd6f59dd8016cd06361f93b2 Mon Sep 17 00:00:00 2001 From: Masaki Muranaka Date: Sat, 6 Apr 2013 18:22:42 +0900 Subject: Add some tests. --- test/t/module.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/t/module.rb') 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 -- cgit v1.2.3