Sha256: a3253c1cac7360069d9cef224cc53aea68cb757dff7b8511dfa1bde3b43c95bf

Contents?: true

Size: 583 Bytes

Versions: 5

Compression:

Stored size: 583 Bytes

Contents

require_relative '../spec_helper'
require_relative '../../lib/bioinform/support/array_product'

describe Array do
  context '::product' do
    it 'should take any number of arrays and product them as if #product was made to first and others' do
      Array.product([1,2,3]).should == [1,2,3].product()
      Array.product([1,2,3],[4,5,6]).should == [1,2,3].product([4,5,6])
      Array.product([1,2,3],[4,5,6],[7,8,9]).should == [1,2,3].product([4,5,6],[7,8,9])
    end
    it 'should return empty array if no arrays\'re given' do
      Array.product().should == []
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bioinform-0.1.17 spec/support/array_product_spec.rb
bioinform-0.1.16 spec/support/array_product_spec.rb
bioinform-0.1.15 spec/support/array_product_spec.rb
bioinform-0.1.14 spec/support/array_product_spec.rb
bioinform-0.1.13 spec/support/array_product_spec.rb