summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_array.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-19 21:47:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-19 21:47:48 +0000
commit1dd21576f2ded2acb7b49e2057df9ee064ac1fd2 (patch)
tree52b386db09c7aaa1c95a210a9411d7423f1c4170 /test/ruby/test_array.rb
parent9aec42d205740247c9c04aa6956af6c556ed3439 (diff)
downloadruby-1dd21576f2ded2acb7b49e2057df9ee064ac1fd2.tar.gz
ruby-1dd21576f2ded2acb7b49e2057df9ee064ac1fd2.tar.xz
ruby-1dd21576f2ded2acb7b49e2057df9ee064ac1fd2.zip
* array.c (take_items), enum.c (enum_zip): tries to convert to
array first. [ruby-core:21442] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r--test/ruby/test_array.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 9edd31dfa..04ed13892 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -1502,6 +1502,11 @@ class TestArray < Test::Unit::TestCase
a = []
[1, 2, 3].zip([:a, :b], ["a", "b", "c", "d"]) {|x| a << x }
assert_equal([[1, :a, "a"], [2, :b, "b"], [3, nil, "c"]], a)
+
+ ary = Object.new
+ def ary.to_a; [1, 2]; end
+ def ary.to_ary; [3, 4]; end
+ assert_equal([[5, 3], [6, 4]], [5, 6].zip(ary))
end
def test_transpose