Browse Source

tests: show how CSVs can include newlines

Sanity check for #145
dev
Andy Meneely 10 years ago
parent
commit
38e3d669c5
  1. 9
      spec/api/api_data_spec.rb
  2. 3
      spec/data/csv/newline.csv

9
spec/api/api_data_spec.rb

@ -58,6 +58,15 @@ describe Squib::Deck do
}) })
end end
it 'loads csv with newlines' do
hash = Squib.csv(file: csv_file('newline.csv'))
expect(hash).to eq({
'title' => ['Foo'],
'level' => [1],
'notes' => ["a\nb"]
})
end
end end
context '#xlsx' do context '#xlsx' do

3
spec/data/csv/newline.csv

@ -0,0 +1,3 @@
title,level,notes
Foo,1,"a
b"
1 title level notes
2 Foo 1 a b
Loading…
Cancel
Save