We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2932041 commit 9433331Copy full SHA for 9433331
spec/features/special_cases/empty_lines_spec.rb
@@ -0,0 +1,18 @@
1
+# frozen_string_literal: true
2
+
3
+fixture_path = 'spec/fixtures'
4
5
+[true, false].each do |bool|
6
+ describe "loading file with empty lines with#{bool ? ' C-' : 'out '}acceleration" do
7
+ let(:options) { { acceleration: bool } }
8
9
+ it 'loads the data correctly' do
10
+ data = SmarterCSV.process("#{fixture_path}/empty_lines.csv", options)
11
12
+ expect(data.length).to eq 2
13
14
+ expect(data[0]).to eq({id: 1, name: 'Bob'})
15
+ expect(data[1]).to eq({id: 2, name: 'Paul'})
16
+ end
17
18
+end
spec/fixtures/empty_lines.csv
@@ -0,0 +1,6 @@
+id,name
+1,Bob
+2,Paul
0 commit comments