From 5e8dc8cd44f501943acbd58229eb6b97894aecaf Mon Sep 17 00:00:00 2001 From: skandhas Date: Mon, 26 Nov 2012 12:06:13 +0800 Subject: add Module#instance_methods test --- test/t/module.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test') diff --git a/test/t/module.rb b/test/t/module.rb index 96bded1ee..e666a1763 100644 --- a/test/t/module.rb +++ b/test/t/module.rb @@ -132,6 +132,26 @@ assert('Module#included_modules', '15.2.2.4.30') do r.class == Array and r.include?(Test4includedModules) end +assert('Module#instance_methods', '15.2.2.4.33') do + module Test4InstanceMethodsA + def method1() end + end + class Test4InstanceMethodsB + def method2() end + end + class Test4InstanceMethodsC < Test4InstanceMethodsB + def method3() end + end + + r = Test4InstanceMethodsC.instance_methods(true) + + Test4InstanceMethodsA.instance_methods == [:method1] and + Test4InstanceMethodsB.instance_methods(false) == [:method2] and + Test4InstanceMethodsC.instance_methods(false) == [:method3] and + r.class == Array and r.include?(:method3) and r.include?(:method2) +end + + # Not ISO specified assert('Module#to_s') do -- cgit v1.2.3