Add quantity explosion to xlsx and csv

Closes #78
This commit is contained in:
Andy Meneely
2015-10-20 18:23:25 -04:00
parent dd1148d68f
commit 08381b86f0
12 changed files with 528 additions and 6 deletions
+14
View File
@@ -36,6 +36,20 @@ describe Squib::Deck do
})
end
it 'explodes quantities' do
expect(Squib.csv(file: csv_file('qty.csv'))).to eq({
'Name' => %w(Ha Ha Ha Ho),
'Qty' => [3, 3, 3, 1],
})
end
it 'explodes quantities on specified header' do
expect(Squib.csv(explode: 'Quantity', file: csv_file('qty_named.csv'))).to eq({
'Name' => %w(Ha Ha Ha Ho),
'Quantity' => [3, 3, 3, 1],
})
end
end
context '#xlsx' do