From 9219c856a8586fbda74fec526303d19c70290484 Mon Sep 17 00:00:00 2001 From: skandhas Date: Sat, 29 Dec 2012 14:44:28 +0800 Subject: add test for Module#remove_method --- test/t/module.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test') diff --git a/test/t/module.rb b/test/t/module.rb index deacb3309..bf9626c2d 100644 --- a/test/t/module.rb +++ b/test/t/module.rb @@ -217,6 +217,25 @@ assert('Module#remove_class_variable', '15.2.2.4.39') do not Test4RemoveClassVariable.class_variables.include? :@@cv end +assert('Module#remove_method', '15.2.2.4.41') do + module Test4RemoveMethod + class Parent + def hello + end + end + + class Child < Parent + def hello + end + end + end + + Test4RemoveMethod::Child.class_eval{ remove_method :hello } + + Test4RemoveMethod::Child.instance_methods.include? :hello and + not Test4RemoveMethod::Child.instance_methods(false).include? :hello +end + # Not ISO specified -- cgit v1.2.3