diff options
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index c71be7d09d..70214c8ff5 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -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 |