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

Version Path
specjour-0.1.18 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.17 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.16 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.15 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.14 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.13 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.12 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.11 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.10 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.9 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.8 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.7 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.6 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.5 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.4 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.3 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.2 spec/lib/specjour/core_ext/array_spec.rb
specjour-0.1.1 spec/lib/specjour/core_ext/array_spec.rb