Sha256: 9cf5e9f546884a98922eab6f8c827622ec035ef95de703a0a08bfe3762105101

Contents?: true

Size: 735 Bytes

Versions: 17

Compression:

Stored size: 735 Bytes

Contents

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'malformed_csv' do
  subject { lambda { SmarterCSV.process(csv_path) } }

  context "malformed header" do
    let(:csv_path) { "#{fixture_path}/malformed_header.csv" }
    it { should raise_error(CSV::MalformedCSVError) }
    it { should raise_error(/(Missing or stray quote in line 1|CSV::MalformedCSVError)/) }
    it { should raise_error(CSV::MalformedCSVError) }
  end

  context "malformed content" do
    let(:csv_path) { "#{fixture_path}/malformed.csv" }
    it { should raise_error(CSV::MalformedCSVError) }
    it { should raise_error(/(Missing or stray quote in line 1|CSV::MalformedCSVError)/) }
    it { should raise_error(CSV::MalformedCSVError) }
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
smarter_csv-1.2.8 spec/smarter_csv/malformed_spec.rb
smarter_csv-1.2.7 spec/smarter_csv/malformed_spec.rb
pokedex-terminal-0.2.8 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/malformed_spec.rb
pokedex-terminal-0.2.7 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/malformed_spec.rb
pokedex-terminal-0.2.6 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/malformed_spec.rb
pokedex-terminal-0.2.5 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/malformed_spec.rb
pokedex-terminal-0.2.4 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/malformed_spec.rb
smarter_csv-1.2.6 spec/smarter_csv/malformed_spec.rb
smarter_csv-1.2.5 spec/smarter_csv/malformed_spec.rb
smarter_csv-1.2.4 spec/smarter_csv/malformed_spec.rb
smarter_csv-1.2.3 spec/smarter_csv/malformed_spec.rb
smarter_csv-1.2.0 spec/smarter_csv/malformed_spec.rb
smarter_csv-1.1.5 spec/smarter_csv/malformed_spec.rb
smarter_csv-1.1.4 spec/smarter_csv/malformed_spec.rb
smarter_csv-1.1.3 spec/smarter_csv/malformed_spec.rb
smarter_csv-1.1.2 spec/smarter_csv/malformed_spec.rb
smarter_csv-1.1.1 spec/smarter_csv/malformed_spec.rb