1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (rb_obj_respond_to): check the result of respond_to? method

by RTEST.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-05-04 05:30:08 +00:00
parent 7ef9aba753
commit f587eab23c
3 changed files with 14 additions and 1 deletions

View file

@ -1403,4 +1403,12 @@ class TestString < Test::Unit::TestCase
s1 << 'a'
}
end
def test_respond_to
o = Object.new
def o.respond_to?(arg) [:to_str].include?(arg) ? nil : super end
def o.to_str() "" end
def o.==(other) "" == other end
assert_equal(false, "" == o)
end
end