summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgogotanaka <gogotanaka@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-22 03:48:23 +0000
committergogotanaka <gogotanaka@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-22 03:48:23 +0000
commit85147e903abe7af170cdc0ad6f9529a7bc2db132 (patch)
tree852f1d8d76c559d3eae6444c0a651595851bfd54
parentb27c5206a3d7f4713760438cecff6659849b82f3 (diff)
* test/ruby/test_object.rb: add tests for Kernel#String and Kernel#Array.
[fix GH-879][fix GH-880] Patch by @yui-knk git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_object.rb4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 74fbb6181e..04eead5db3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Apr 22 12:42:12 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+
+ * test/ruby/test_object.rb: add tests for Kernel#String and Kernel#Array.
+ [fix GH-879][fix GH-880] Patch by @yui-knk
+
Tue Apr 21 20:46:02 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
* test/ruby/test_object.rb: renamed tests to explicitly class name.
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