aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_array.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r--test/ruby/test_array.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 04ed13892b..1cd018be85 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -1505,8 +1505,11 @@ class TestArray < Test::Unit::TestCase
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))
+ assert_raise(NoMethodError){ %w(a b).zip(ary) }
+ def ary.each; [3, 4].each{|e|yield e}; end
+ assert_equal([['a', 3], ['b', 4]], %w(a b).zip(ary))
+ def ary.to_ary; [5, 6]; end
+ assert_equal([['a', 5], ['b', 6]], %w(a b).zip(ary))
end
def test_transpose