Sha256: 1873c36ed8e46a890a2af62c7e220d13044a2369175b14c1c5972a17f9d2f1d2
Contents?: true
Size: 612 Bytes
Versions: 38
Compression:
Stored size: 612 Bytes
Contents
require 'rspec' require 'abstractivator/collections' describe Abstractivator::Collections do include Abstractivator::Collections describe '#multizip' do it 'transposes' do xs = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] expect(multizip(xs)).to eql [[1, 4, 7], [2, 5, 8], [3, 6, 9]] expect(multizip([])).to eql [] end it 'uses a default value past the end of shorter enumerables' do xs = [[1, 2, 3], [4], [7, 8, 9]] expect(multizip(xs)).to eql [[1, 4, 7], [2, nil, 8], [3, nil, 9]] expect(multizip(xs, -1)).to eql [[1, 4, 7], [2, -1, 8], [3, -1, 9]] end end end
Version data entries
38 entries across 38 versions & 1 rubygems