diff options
| author | skandhas <[email protected]> | 2012-11-26 12:06:13 +0800 |
|---|---|---|
| committer | skandhas <[email protected]> | 2012-11-26 12:06:13 +0800 |
| commit | 5e8dc8cd44f501943acbd58229eb6b97894aecaf (patch) | |
| tree | d07d5ac4874bb05642cb1f0a868362992d0461c3 /test | |
| parent | 6fb74ac167f6b7e55d126159764ed7dca0c400d5 (diff) | |
| download | mruby-5e8dc8cd44f501943acbd58229eb6b97894aecaf.tar.gz mruby-5e8dc8cd44f501943acbd58229eb6b97894aecaf.zip | |
add Module#instance_methods test
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/module.rb | 20 |
1 files changed, 20 insertions, 0 deletions
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 |
