diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-11-26 20:22:12 -0800 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-11-26 20:22:12 -0800 |
| commit | 2ea245db3dd439cf179bbe120177ddcd086e4707 (patch) | |
| tree | 437e160870f1a1e30af027dba9e89a6e7efdb782 /test/t | |
| parent | d03bd87dc0213954f1f15c24507b38d1820192eb (diff) | |
| parent | 1f3c5125648e10ac5d9dc90be66025b4741fa24d (diff) | |
| download | mruby-2ea245db3dd439cf179bbe120177ddcd086e4707.tar.gz mruby-2ea245db3dd439cf179bbe120177ddcd086e4707.zip | |
Merge pull request #572 from skandhas/pr-add-Module-instance_methods
add "Module#instance_methods" for mruby
Diffstat (limited to 'test/t')
| -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 |
