Sha256: 7dd190c3a72ac578b452f57d9ff3e24f844c53f2f6c9288dad17208f711263da

Contents?: true

Size: 493 Bytes

Versions: 2

Compression:

Stored size: 493 Bytes

Contents

# frozen_string_literal: true

describe LokaliseManager::Utils::ArrayUtils do
  using described_class
  let(:arr) { (1..8).to_a }

  describe '#in_groups_of' do
    it 'raises an exception when the number is less than 1' do
      expect(-> { arr.in_groups_of(-1) }).to raise_error(ArgumentError)
    end

    it 'uses collection itself if fill_with is false' do
      enum = arr.in_groups_of(5, false)
      enum.next
      expect(enum.next.count).to eq(3)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lokalise_manager-2.1.0 spec/lib/utils/array_utils_spec.rb
lokalise_manager-2.0.0 spec/lib/utils/array_utils_spec.rb