Skip to content

Commit

Permalink
Add RSpec tests for windows line ending
Browse files Browse the repository at this point in the history
  • Loading branch information
SaravShah committed Oct 8, 2018
1 parent ffbb6de commit 2ddd0c6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/lib/csv_importer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,18 @@
expect(manifest).to all(include(*headers))
expect(manifest.pluck(:description)).to eq([nil, '', 'yo, this is a description'])
end
context "windows manifest.csv" do
let(:manifest) do
described_class.parse_to_hash("#{Rails.root}/spec/test_data/windows_manifest/manifest.csv")
end

it 'loads a CSV as a hash and provides values' do
expect(manifest.size).to eq(7)
expect(manifest).to be_an(Array)
headers = %w[object druid]
expect(manifest).to all(be_an(ActiveSupport::HashWithIndifferentAccess)) # accessible w/ string and symbols
expect(manifest).to all(include(*headers))
end
end
end
end

0 comments on commit 2ddd0c6

Please sign in to comment.