summaryrefslogtreecommitdiff
path: root/test/ruby/test_object.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_object.rb')
-rw-r--r--test/ruby/test_object.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb
index 29ca2e58f1..ad836fca8f 100644
--- a/test/ruby/test_object.rb
+++ b/test/ruby/test_object.rb
@@ -244,6 +244,8 @@ class TestObject < Test::Unit::TestCase
assert_raise(TypeError) { String(o) }
def o.to_s; "o"; end
assert_equal("o", String(o))
+ def o.to_str; "O"; end
+ assert_equal("O", String(o))
def o.respond_to?(*) false; end
assert_raise(TypeError) { String(o) }
end
@@ -254,6 +256,8 @@ class TestObject < Test::Unit::TestCase
assert_raise(TypeError) { Array(o) }
def o.to_a; [1]; end
assert_equal([1], Array(o))
+ def o.to_ary; [2]; end
+ assert_equal([2], Array(o))
def o.respond_to?(*) false; end
assert_equal([o], Array(o))
end