Permalink
Browse files

regression test for gh #482

  • Loading branch information...
1 parent 18aac56 commit 7c86c1350540817a38d0d89f7e28b6a286063309 Isaiah Peng committed Jan 8, 2013
Showing with 24 additions and 1 deletion.
  1. +24 −0 spec/regression/gh-482_array_zip_cycle.rb
  2. +0 −1 src/org/jruby/RubyArray.java
@@ -0,0 +1,24 @@
+require 'rspec'
+
+describe "zip an array with" do
+ it "infinite enum returns a correct new array" do
+ [1,2].zip([0].cycle).should == [[1,0], [2,0]]
+ end
+
+ it "infinite enum append block is yield with corrent argument" do
+ arr = []
+ [1,2].zip([0].cycle){|a| arr << a}
+ arr.should == [[1,0], [2,0]]
+ end
+
+ it "another array returns a correct new array" do
+ [1,2].zip([0]).should == [[1,0],[2,nil]]
+ end
+
+ it "another array append block is yield with corrent argument" do
+ arr = []
+ [1,2].zip([0]){|a| arr << a}
+ arr.should == [[1,0], [2,nil]]
+ end
+end
+
@@ -67,7 +67,6 @@
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.ThreadContext;
-import static org.jruby.javasupport.util.RuntimeHelpers.argsCat;
import static org.jruby.runtime.Visibility.*;
import static org.jruby.CompatVersion.*;
import org.jruby.java.util.ArrayUtils;

0 comments on commit 7c86c13

Please sign in to comment.