diff options
| author | Carson McDonald <[email protected]> | 2013-04-20 07:47:58 -0400 |
|---|---|---|
| committer | Carson McDonald <[email protected]> | 2013-04-20 07:47:58 -0400 |
| commit | 54e1ed20f95fad747be5d0b15c81cd9a1ce20a9e (patch) | |
| tree | 49f6632e6b59fcbf34dd14ea21a7bbf48a510c2d /test | |
| parent | cc512dd8d0bd17fa6fba3dfc1b4046b4d4faf68b (diff) | |
| download | mruby-54e1ed20f95fad747be5d0b15c81cd9a1ce20a9e.tar.gz mruby-54e1ed20f95fad747be5d0b15c81cd9a1ce20a9e.zip | |
Add a test for respond_to_missing?
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/kernel.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/t/kernel.rb b/test/t/kernel.rb index abc8f260b..f2f387bb2 100644 --- a/test/t/kernel.rb +++ b/test/t/kernel.rb @@ -392,3 +392,16 @@ assert('Kernel#!=') do (str1 != str3) == true and (str2 != str1) == false end + +assert('Kernel#respond_to_missing?') do + + class Test4RespondToMissing + def respond_to_missing?(method_name, include_private = false) + method_name == :a_method + end + end + + Test4RespondToMissing.new.respond_to?(:a_method) == true and + Test4RespondToMissing.new.respond_to?(:no_method) == false + +end |
