Skip to content

Commit

Permalink
Add regression spec for roo-rb#37
Browse files Browse the repository at this point in the history
Apparently #parse is pretty weird in that it includes the header
row in the result, as a hash with header keys and values.
  • Loading branch information
Empact committed Aug 7, 2013
1 parent 52d5348 commit d340430
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 3 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- replace builder gem with Nokogiri:Builder
- New parameter at #new specifying the name of the directory for the roo temporary files
- New parameter at #new specifying the name of the directory for the roo temporary files?
- Current #parse(headers: true)'s first entry is a hash of the header row as both
keys and values. :-P
13 changes: 13 additions & 0 deletions spec/lib/roo/csv_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
describe Roo::Csv do
let(:path) { 'test/files/csvtypes.csv' }

describe '#parse' do
subject {
Roo::Csv.new(path).parse(options)
}
context 'with headers: true' do
let(:options) { {headers: true} }

it "doesn't blow up" do
expect { subject }.to_not raise_error
end
end
end

describe '#csv_options' do
context 'when created with the csv_options option' do
let(:options) {
Expand Down

0 comments on commit d340430

Please sign in to comment.