diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-01-04 03:25:50 -0800 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-01-04 03:25:50 -0800 |
| commit | db2fed84d1414331b95f30d84912295a276c4837 (patch) | |
| tree | 53a1947c1ce64894cb4e34a207babf06a09ed5f3 /test | |
| parent | 5df3a9dbdf947e4f0222b92d29c213fb48f53821 (diff) | |
| parent | c4995884e6209d837bae46e4547202352f7436d8 (diff) | |
| download | mruby-db2fed84d1414331b95f30d84912295a276c4837.tar.gz mruby-db2fed84d1414331b95f30d84912295a276c4837.zip | |
Merge pull request #686 from skandhas/pr-add-Module-method_defined
Add Module#method_defined? for mruby
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/module.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/t/module.rb b/test/t/module.rb index bf9626c2d..286c2c085 100644 --- a/test/t/module.rb +++ b/test/t/module.rb @@ -199,6 +199,30 @@ assert('Module#instance_methods', '15.2.2.4.33') do r.class == Array and r.include?(:method3) and r.include?(:method2) end +assert('Module#method_defined?', '15.2.2.4.34') do + module Test4MethodDefined + module A + def method1() end + end + + class B + def method2() end + end + + class C < B + include A + def method3() end + end + end + + Test4MethodDefined::A.method_defined? :method1 and + Test4MethodDefined::C.method_defined? :method1 and + Test4MethodDefined::C.method_defined? "method2" and + Test4MethodDefined::C.method_defined? "method3" and + not Test4MethodDefined::C.method_defined? "method4" +end + + assert('Module#module_eval', '15.2.2.4.35') do module Test4ModuleEval @a = 11 |
