spec/csv2hash/structure_validator_spec.rb in csv2hash-0.2.1 vs spec/csv2hash/structure_validator_spec.rb in csv2hash-0.3.0
- old
+ new
@@ -11,11 +11,11 @@
definition.default!
end
end
subject do
- Csv2hash.new(definition, 'file_path', exception_mode, data_source)
+ Csv2hash::Main.new(definition, data_source, exception_mode, ignore_blank_line=false)
end
context 'the csv with errors' do
let(:options){ { structure_rules: { 'MaxColumns' => 2 } } }
let(:exception_mode) { false }
@@ -27,11 +27,11 @@
]
end
its(:csv_with_errors) { should be_kind_of CsvArray }
it "adds structure error in first cell" do
- subject.csv_with_errors.first[:message].should eq 'Too many columns (max. 2) on line 1'
+ expect(subject.csv_with_errors.first[:message]).to eq 'Too many columns (max. 2) on line 1'
end
end
context '#MaxColumns' do
@@ -78,6 +78,6 @@
end
it { expect { subject.validate_structure! }.to raise_error 'Not enough columns (min. 2) on line 0' }
end
end
-end
\ No newline at end of file
+end