Sha256: 6e7918e21fb0c3a2ffb6437586cb566f066d337ecbbbbb307b046e2aa90e50fb
Contents?: true
Size: 650 Bytes
Versions: 18
Compression:
Stored size: 650 Bytes
Contents
require 'spec_helper' describe "Array splitting among many" do describe "#among" do let(:array) { [1,2,3,4,5] } it "splits among 0" do array.among(0).should == [[1,2,3,4,5]] end it "splits among by 1" do array.among(1).should == [[1,2,3,4,5]] end it "splits among by 2" do array.among(2).should == [[1,3,5],[2,4]] end it "splits among by 3" do array.among(3).should == [[1,4],[2,5],[3]] end it "splits among by 4" do array.among(4).should == [[1,5],[2],[3],[4]] end it "splits among by 5" do array.among(5).should == [[1],[2],[3],[4],[5]] end end end
Version data entries
18 entries across 18 versions & 1 rubygems