Skip to content

Commit

Permalink
Change fixtrues
Browse files Browse the repository at this point in the history
  • Loading branch information
nicastelo committed Mar 14, 2024
1 parent 14cf38e commit 078c13b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 5 additions & 3 deletions spec/features/formating/column_separator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,12 @@
end

it 'does not detect separators that are between quotes' do
data = SmarterCSV.process("#{fixture_path}/separator_chars_between_quotes_no_headers.csv", options)
data = SmarterCSV.process(
"#{fixture_path}/separator_chars_between_quotes_no_headers.csv",
options.merge(user_provided_headers: %w[Name Age Job Department Project])
)


expect(data.first.keys.size).to eq 4
expect(data.first.keys.size).to eq 5
expect(data.size).to eq 3
end

Expand Down
8 changes: 4 additions & 4 deletions spec/fixtures/separator_chars_between_quotes.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"name; info":"age, years":"job; title":"department":"project; code"
"John, Doe":"35":"Senior; Developer":"Engineering":"Code:1234"
"Jane; Smith":"29":"Project, Manager":"Product; Development":"Code,5678"
"Emily\tJones":"42":"CTO":"Technology\t":"Code\t9012"
"name, info":"age, years":"job, title":"department, info":"project, code"
"John, Doe":"35, years":"Senior, Developer":"Engineering, Dept":"Code, 1234"
"Jane, Smith":"29, years":"Project, Manager":"Product, Development":"Code,5678"
"Emily, Jones":"42, years":"CTO,":"Technology,Dept":"Code,9012"
6 changes: 3 additions & 3 deletions spec/fixtures/separator_chars_between_quotes_no_headers.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"John, Doe":"35":"Senior; Developer":"Engineering":"Code:1234"
"Jane; Smith":"29":"Project, Manager":"Product; Development":"Code,5678"
"Emily\tJones":"42":"CTO":"Technology\t":"Code\t9012"
"John, Doe":"35, years":"Senior, Developer":"Engineering, Dept":"Code, 1234"
"Jane, Smith":"29, years":"Project, Manager":"Product, Development":"Code,5678"
"Emily, Jones":"42, years":"CTO,":"Technology,Dept":"Code,9012"

0 comments on commit 078c13b

Please sign in to comment.