spec/csv2hash/parser/collection_spec.rb in csv2hash-0.4.0 vs spec/csv2hash/parser/collection_spec.rb in csv2hash-0.5.0
- old
+ new
@@ -5,13 +5,14 @@
let(:definition) do
Csv2hash::Definition.new [ { position: 0, key: 'name' } ], Csv2hash::Definition::COLLECTION
end
let(:data_source) { [ [ 'John Doe' ], [ 'Jane Doe' ] ] }
+ let(:ignore_blank_line) { false }
subject do
- Csv2hash::Main.new(definition, data_source, ignore_blank_line=false)
+ Csv2hash::Main.new(definition, data_source, ignore_blank_line: ignore_blank_line)
end
context 'regular way' do
it { expect { subject.parse }.to_not raise_error }
it {
@@ -45,12 +46,12 @@
}
end
context '#ignore_blank_line' do
let(:data_source) { [ [ 'John Doe' ], [ 'Jane Doe' ], [ nil ] ] }
+ let(:ignore_blank_line) { true }
it {
expect(subject.tap do |parser|
- parser.ignore_blank_line = true
parser.parse
end.data).to eql({ data: [ { 'name' => 'John Doe' }, { 'name' => 'Jane Doe' } ] })
}
end
end