Permalink
Browse files

Adding a few more respond_to tests

  • Loading branch information...
1 parent 5e40c9b commit 61c0b8f7df0a10241444cd70ad5395b605f968bc @carsonmcdonald carsonmcdonald committed May 5, 2013
Showing with 15 additions and 1 deletion.
  1. +15 −1 test/t/kernel.rb
View
@@ -354,12 +354,26 @@ def test_method; end
# Kernel#require is defined in mruby-require. '15.3.1.3.42'
assert('Kernel#respond_to?', '15.3.1.3.43') do
+ e_list = []
+
class Test4RespondTo
+ def valid_method; end
+
def test_method; end
undef test_method
end
- respond_to?(:nil?) and Test4RespondTo.new.respond_to?(:test_method) == false
+ begin
+ Test4RespondTo.new.respond_to?(1)
+ rescue => e
+ e_list << e.class
+ end
+
+ e_list[0] == TypeError and
+ respond_to?(:nil?) and
+ Test4RespondTo.new.respond_to?(:valid_method) == true and
+ Test4RespondTo.new.respond_to?('valid_method') == true and
+ Test4RespondTo.new.respond_to?(:test_method) == false
end
assert('Kernel#send', '15.3.1.3.44') do

0 comments on commit 61c0b8f

Please sign in to comment.