From cb327bea4ee75f3bc1325279d394913b3fc84caa Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 12:03:30 +0000 Subject: [PATCH 01/15] Add information message levels --- .../step_definitions/validation_info_steps.rb | 18 +++++++++++++ lib/csvlint/error_collector.rb | 27 ++++++++++++------- 2 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 features/step_definitions/validation_info_steps.rb diff --git a/features/step_definitions/validation_info_steps.rb b/features/step_definitions/validation_info_steps.rb new file mode 100644 index 00000000..c2152d96 --- /dev/null +++ b/features/step_definitions/validation_info_steps.rb @@ -0,0 +1,18 @@ +Given(/^I ask if there are info messages$/) do + @csv_options ||= default_csv_options + + if @schema_json + @schema = Csvlint::Schema.from_json_table( @schema_url || "http://example.org ", JSON.parse(@schema_json) ) + end + + @validator = Csvlint::Validator.new( @url, @csv_options, @schema ) + @info_messages = @validator.info_messages +end + +Then(/^there should be (\d+) info messages?$/) do |num| + @info_messages.count.should == num.to_i +end + +Then(/^that message should have the type "(.*?)"$/) do |msg_type| + @info_messages.first.type.should == msg_type.to_sym +end \ No newline at end of file diff --git a/lib/csvlint/error_collector.rb b/lib/csvlint/error_collector.rb index b921a1b5..8debe27a 100644 --- a/lib/csvlint/error_collector.rb +++ b/lib/csvlint/error_collector.rb @@ -1,9 +1,7 @@ module Csvlint module ErrorCollector - - attr_reader :errors, :warnings - + def build_message(type, category, row, column, content) Csvlint::ErrorMessage.new({ :type => type, @@ -14,12 +12,20 @@ def build_message(type, category, row, column, content) }) end - def build_errors(type, category = nil, row = nil, column = nil, content = nil) - @errors << build_message(type, category, row, column, content) - end + MESSAGE_LEVELS = [ + :errors, + :warnings, + :info_messages + ] - def build_warnings(type, category = nil, row = nil, column = nil, content = nil) - @warnings << build_message(type, category, row, column, content) + MESSAGE_LEVELS.each do |level| + + attr_reader level + + define_method "build_#{level}" do |type, category = nil, row = nil, column = nil, content = nil| + instance_variable_get("@#{level}") << build_message(type, category, row, column, content) + end + end def valid? @@ -27,8 +33,9 @@ def valid? end def reset - @errors = [] - @warnings = [] + MESSAGE_LEVELS.each do |level| + instance_variable_set("@#{level}", []) + end end end From c04865f3f7f113dba49e08b154779d507941f298 Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 12:03:44 +0000 Subject: [PATCH 02/15] Turn line breaks into information, not error --- features/validation_errors.feature | 15 +-------------- features/validation_info.feature | 14 ++++++++++++++ lib/csvlint/validate.rb | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 features/validation_info.feature diff --git a/features/validation_errors.feature b/features/validation_errors.feature index ec5830a2..3ac2803a 100644 --- a/features/validation_errors.feature +++ b/features/validation_errors.feature @@ -138,17 +138,4 @@ Feature: Get validation errors And it is stored at the url "http://example.com/example1.csv" And I ask if there are errors Then there should be 1 error - And that error should have the type "line_breaks" - - Scenario: Incorrect line endings in file - Given I have a CSV file called "incorrect-line-endings.csv" - And it is stored at the url "http://example.com/example1.csv" - And I ask if there are errors - Then there should be 1 error - And that error should have the type "line_breaks" - - Scenario: Incorrect line endings in file - Given I have a CSV with carriage returns in fields - And it is stored at the url "http://example.com/example1.csv" - And I ask if there are errors - Then there should be 0 error \ No newline at end of file + And that error should have the type "line_breaks" \ No newline at end of file diff --git a/features/validation_info.feature b/features/validation_info.feature new file mode 100644 index 00000000..15cf656a --- /dev/null +++ b/features/validation_info.feature @@ -0,0 +1,14 @@ +Feature: Get validation information messages + + Scenario: Incorrect line endings in file + Given I have a CSV file called "incorrect-line-endings.csv" + And it is stored at the url "http://example.com/example1.csv" + And I ask if there are info messages + Then there should be 1 info message + And that message should have the type "line_breaks" + + Scenario: Incorrect line endings in file + Given I have a CSV with carriage returns in fields + And it is stored at the url "http://example.com/example1.csv" + And I ask if there are info messages + Then there should be 0 info messages diff --git a/lib/csvlint/validate.rb b/lib/csvlint/validate.rb index d7f98544..15c19376 100644 --- a/lib/csvlint/validate.rb +++ b/lib/csvlint/validate.rb @@ -91,7 +91,7 @@ def parse_csv(io) wrapper.finished type = fetch_error(e) if type == :quoting && wrapper.line.match(/[^\r]\n/) - build_errors(:line_breaks, :structure) + build_info_messages(:line_breaks, :structure) else build_errors(type, :structure, current_line, nil, wrapper.line) end From 49814b7ed416bcf5a722d3416a96bb1f377bde3e Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 13:30:37 +0000 Subject: [PATCH 03/15] Update tests to show info on LF line ending, but error on CR or other --- .../{incorrect-line-endings.csv => cr-line-endings.csv} | 0 features/fixtures/lf-line-endings.csv | 2 ++ features/validation_errors.feature | 7 +++++++ features/validation_info.feature | 8 ++++---- 4 files changed, 13 insertions(+), 4 deletions(-) rename features/fixtures/{incorrect-line-endings.csv => cr-line-endings.csv} (100%) create mode 100644 features/fixtures/lf-line-endings.csv diff --git a/features/fixtures/incorrect-line-endings.csv b/features/fixtures/cr-line-endings.csv similarity index 100% rename from features/fixtures/incorrect-line-endings.csv rename to features/fixtures/cr-line-endings.csv diff --git a/features/fixtures/lf-line-endings.csv b/features/fixtures/lf-line-endings.csv new file mode 100644 index 00000000..682871ee --- /dev/null +++ b/features/fixtures/lf-line-endings.csv @@ -0,0 +1,2 @@ +"Foo","Bsr","Baz" +"Biff","Baff","Boff" diff --git a/features/validation_errors.feature b/features/validation_errors.feature index 3ac2803a..0ee71c38 100644 --- a/features/validation_errors.feature +++ b/features/validation_errors.feature @@ -138,4 +138,11 @@ Feature: Get validation errors And it is stored at the url "http://example.com/example1.csv" And I ask if there are errors Then there should be 1 error + And that error should have the type "line_breaks" + + Scenario: CR line endings in file cause an error + Given I have a CSV file called "cr-line-endings.csv" + And it is stored at the url "http://example.com/example1.csv" + And I ask if there are errors + Then there should be 1 error And that error should have the type "line_breaks" \ No newline at end of file diff --git a/features/validation_info.feature b/features/validation_info.feature index 15cf656a..5ee9de1c 100644 --- a/features/validation_info.feature +++ b/features/validation_info.feature @@ -1,13 +1,13 @@ Feature: Get validation information messages - Scenario: Incorrect line endings in file - Given I have a CSV file called "incorrect-line-endings.csv" + Scenario: LF line endings in file give an info message + Given I have a CSV file called "lf-line-endings.csv" And it is stored at the url "http://example.com/example1.csv" And I ask if there are info messages Then there should be 1 info message - And that message should have the type "line_breaks" + And that message should have the type "lf_line_breaks" - Scenario: Incorrect line endings in file + Scenario: Correct line endings in file produces no info messages Given I have a CSV with carriage returns in fields And it is stored at the url "http://example.com/example1.csv" And I ask if there are info messages From 385ab8d0f8b8accd7d0af0a5af9dfd29593ad863 Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 13:56:44 +0000 Subject: [PATCH 04/15] Change unknown line break message back to error --- lib/csvlint/validate.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/csvlint/validate.rb b/lib/csvlint/validate.rb index 15c19376..d7f98544 100644 --- a/lib/csvlint/validate.rb +++ b/lib/csvlint/validate.rb @@ -91,7 +91,7 @@ def parse_csv(io) wrapper.finished type = fetch_error(e) if type == :quoting && wrapper.line.match(/[^\r]\n/) - build_info_messages(:line_breaks, :structure) + build_errors(:line_breaks, :structure) else build_errors(type, :structure, current_line, nil, wrapper.line) end From 20b4b192addce7a12a16db4835e81aaabc0f101b Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 15:39:46 +0000 Subject: [PATCH 05/15] Delegate all missing methods from WrappedIO to @io So it looks like a proper IO object --- lib/csvlint/wrapped_io.rb | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/csvlint/wrapped_io.rb b/lib/csvlint/wrapped_io.rb index 6c44ac5f..a0bf9bd1 100644 --- a/lib/csvlint/wrapped_io.rb +++ b/lib/csvlint/wrapped_io.rb @@ -5,13 +5,18 @@ def initialize(io) @line = "" end - def gets(delim) - @line = "" if @new_line - s = @io.gets(delim) - if s != nil - @line << s + def gets(*args) + if args.count == 1 && args[0].is_a?(String) + delim = args[0] + @line = "" if @new_line + s = @io.gets(delim) + if s != nil + @line << s + end + return s + else + @io.gets(*args) end - return s end def eof? @@ -25,5 +30,10 @@ def finished def line @line end + + def method_missing(method, *args) + @io.send(method, *args) + end + end end \ No newline at end of file From b56f51b833c32fdbf38d57d2c5fbf95fe5c927c7 Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 15:40:29 +0000 Subject: [PATCH 06/15] rationalise line ending tests --- features/validation_errors.feature | 9 +++------ features/validation_info.feature | 13 ++++++++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/features/validation_errors.feature b/features/validation_errors.feature index 0ee71c38..db106465 100644 --- a/features/validation_errors.feature +++ b/features/validation_errors.feature @@ -130,18 +130,15 @@ Feature: Get validation errors And that error should have the type "not_found" Scenario: Incorrect line endings specified in settings - Given I have a CSV with the following content: - """ -"abc","2","3" - """ + Given I have a CSV file called "cr-line-endings.csv" And I set the line endings to linefeed And it is stored at the url "http://example.com/example1.csv" And I ask if there are errors Then there should be 1 error And that error should have the type "line_breaks" - Scenario: CR line endings in file cause an error - Given I have a CSV file called "cr-line-endings.csv" + Scenario: inconsistent line endings in file cause an error + Given I have a CSV file called "inconsistent-line-endings.csv" And it is stored at the url "http://example.com/example1.csv" And I ask if there are errors Then there should be 1 error diff --git a/features/validation_info.feature b/features/validation_info.feature index 5ee9de1c..cbb9d701 100644 --- a/features/validation_info.feature +++ b/features/validation_info.feature @@ -5,10 +5,17 @@ Feature: Get validation information messages And it is stored at the url "http://example.com/example1.csv" And I ask if there are info messages Then there should be 1 info message - And that message should have the type "lf_line_breaks" + And that message should have the type "nonrfc_line_breaks" - Scenario: Correct line endings in file produces no info messages - Given I have a CSV with carriage returns in fields + Scenario: CR line endings in file give an info message + Given I have a CSV file called "cr-line-endings.csv" + And it is stored at the url "http://example.com/example1.csv" + And I ask if there are info messages + Then there should be 1 info message + And that message should have the type "nonrfc_line_breaks" + + Scenario: CRLF line endings in file produces no info messages + Given I have a CSV file called "crlf-line-endings.csv" And it is stored at the url "http://example.com/example1.csv" And I ask if there are info messages Then there should be 0 info messages From 467b299ea5b310aa4e7fd8f2aa15d7aad9fa34a5 Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 15:40:42 +0000 Subject: [PATCH 07/15] remove unused step --- features/step_definitions/validation_errors_steps.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/features/step_definitions/validation_errors_steps.rb b/features/step_definitions/validation_errors_steps.rb index 7d116b36..d50d6186 100644 --- a/features/step_definitions/validation_errors_steps.rb +++ b/features/step_definitions/validation_errors_steps.rb @@ -40,8 +40,4 @@ Then(/^there should be no "(.*?)" errors$/) do |type| @errors.each do |error| error.type.should_not == type.to_sym end -end - -Given(/^I have a CSV with carriage returns in fields$/) do - @csv = "\"Foo\",\"Bar\",\"Baz\"\r\n\"Bing\",\"Bang\nBung\",\"Bong\"" end \ No newline at end of file From face21d4015971efedce0b60ffa3587799d8f880 Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 15:40:59 +0000 Subject: [PATCH 08/15] remove default line ending --- features/support/env.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/features/support/env.rb b/features/support/env.rb index 6b8097f2..bb745b8a 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -21,7 +21,6 @@ class CustomWorld def default_csv_options return { - "lineTerminator" => "\r\n" } end end From 54609e0618cec215ef2cf77e40b388c478b615ad Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 15:41:12 +0000 Subject: [PATCH 09/15] Add CSV line ending test files --- features/fixtures/cr-line-endings.csv | 3 +-- features/fixtures/crlf-line-endings.csv | 2 ++ features/fixtures/inconsistent-line-endings.csv | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 features/fixtures/crlf-line-endings.csv create mode 100644 features/fixtures/inconsistent-line-endings.csv diff --git a/features/fixtures/cr-line-endings.csv b/features/fixtures/cr-line-endings.csv index 682871ee..121d90b8 100644 --- a/features/fixtures/cr-line-endings.csv +++ b/features/fixtures/cr-line-endings.csv @@ -1,2 +1 @@ -"Foo","Bsr","Baz" -"Biff","Baff","Boff" +"Foo","Bsr","Baz" "Biff","Baff","Boff" \ No newline at end of file diff --git a/features/fixtures/crlf-line-endings.csv b/features/fixtures/crlf-line-endings.csv new file mode 100644 index 00000000..f23e6cfb --- /dev/null +++ b/features/fixtures/crlf-line-endings.csv @@ -0,0 +1,2 @@ +"Foo","Bsr","Baz" +"Biff","Baff","Boff" diff --git a/features/fixtures/inconsistent-line-endings.csv b/features/fixtures/inconsistent-line-endings.csv new file mode 100644 index 00000000..81c86d4c --- /dev/null +++ b/features/fixtures/inconsistent-line-endings.csv @@ -0,0 +1 @@ +"Foo","Bsr","Baz" "Biff","Baff","Boff" From bee9c517552e9997b22c1ceecb19b2c3d2943b5f Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 15:41:47 +0000 Subject: [PATCH 10/15] Autodetect csv line endings --- lib/csvlint/validate.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/csvlint/validate.rb b/lib/csvlint/validate.rb index d7f98544..c1199910 100644 --- a/lib/csvlint/validate.rb +++ b/lib/csvlint/validate.rb @@ -17,7 +17,6 @@ def initialize(source, dialect = nil, schema = nil) @formats = [] @schema = schema @csv_options = dialect_to_csv_options(dialect) - @csv_options[:row_sep] == nil ? @line_terminator = $/ : @line_terminator = @csv_options[:row_sep] @extension = parse_extension(source) reset @@ -54,7 +53,6 @@ def validate_metadata(io) build_warnings(:excel, :context) if @content_type == nil && @extension =~ /.xls(x)?/ build_errors(:wrong_content_type, :context) unless (@content_type && @content_type =~ /text\/csv/) end - build_errors(:line_breaks, :structure) unless @line_terminator == "\r\n" end def parse_csv(io) @@ -119,7 +117,7 @@ def dialect_to_csv_options(dialect) delimiter = delimiter + " " if !skipinitialspace return { :col_sep => delimiter, - :row_sep => ( dialect["lineTerminator"] || "\r\n" ), + :row_sep => ( dialect["lineTerminator"] || :auto), :quote_char => ( dialect["quoteChar"] || '"'), :skip_blanks => false } From 0f6fc7aca143640e7e898292e3e00eef7b461b3c Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 15:42:38 +0000 Subject: [PATCH 11/15] Give info message for non-CRLF line endings --- lib/csvlint/validate.rb | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/csvlint/validate.rb b/lib/csvlint/validate.rb index c1199910..5a20bdc5 100644 --- a/lib/csvlint/validate.rb +++ b/lib/csvlint/validate.rb @@ -62,10 +62,14 @@ def parse_csv(io) @csv_options[:encoding] = @encoding - wrapper = WrappedIO.new( io ) - csv = CSV.new( wrapper , @csv_options ) - row = nil - loop do + begin + wrapper = WrappedIO.new( io ) + csv = CSV.new( wrapper, @csv_options ) + if csv.row_sep != "\r\n" + build_info_messages(:nonrfc_line_breaks, :structure) + end + row = nil + loop do current_line = current_line + 1 begin row = csv.shift @@ -93,12 +97,13 @@ def parse_csv(io) else build_errors(type, :structure, current_line, nil, wrapper.line) end - rescue ArgumentError => ae - wrapper.finished - build_errors(:invalid_encoding, :structure, current_line, wrapper.line) unless reported_invalid_encoding - reported_invalid_encoding = true end end + rescue ArgumentError => ae + wrapper.finished + build_errors(:invalid_encoding, :structure, current_line, wrapper.line) unless reported_invalid_encoding + reported_invalid_encoding = true + end return expected_columns end From e6e0e0d94bd5b246fb53698ff036c7e4e15f0a5f Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 15:43:27 +0000 Subject: [PATCH 12/15] default CSV line end is auto --- spec/validator_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/validator_spec.rb b/spec/validator_spec.rb index 507501cb..fc26cb9d 100644 --- a/spec/validator_spec.rb +++ b/spec/validator_spec.rb @@ -12,7 +12,7 @@ opts = validator.dialect_to_csv_options( nil ) opts.should == { :col_sep => ",", - :row_sep => "\r\n", + :row_sep => :auto, :quote_char => '"', :skip_blanks => false } From c6c1aa662b636b9b65827e7466aba13b7c27e1a0 Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 15:53:25 +0000 Subject: [PATCH 13/15] remove trailing newlines in test CSVs --- features/fixtures/cr-line-endings.csv | 2 +- features/fixtures/crlf-line-endings.csv | 1 + features/fixtures/inconsistent-line-endings.csv | 1 + features/fixtures/lf-line-endings.csv | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/features/fixtures/cr-line-endings.csv b/features/fixtures/cr-line-endings.csv index 121d90b8..d1105f1f 100644 --- a/features/fixtures/cr-line-endings.csv +++ b/features/fixtures/cr-line-endings.csv @@ -1 +1 @@ -"Foo","Bsr","Baz" "Biff","Baff","Boff" \ No newline at end of file +"Foo","Bar","Baz" "Biff","Baff","Boff" "Qux","Teaspoon","Doge" \ No newline at end of file diff --git a/features/fixtures/crlf-line-endings.csv b/features/fixtures/crlf-line-endings.csv index f23e6cfb..89b0eea2 100644 --- a/features/fixtures/crlf-line-endings.csv +++ b/features/fixtures/crlf-line-endings.csv @@ -1,2 +1,3 @@ "Foo","Bsr","Baz" "Biff","Baff","Boff" +"Qux","Teaspoon","Doge" \ No newline at end of file diff --git a/features/fixtures/inconsistent-line-endings.csv b/features/fixtures/inconsistent-line-endings.csv index 81c86d4c..264c4bc0 100644 --- a/features/fixtures/inconsistent-line-endings.csv +++ b/features/fixtures/inconsistent-line-endings.csv @@ -1 +1,2 @@ "Foo","Bsr","Baz" "Biff","Baff","Boff" +"Qux","Teaspoon","Doge" \ No newline at end of file diff --git a/features/fixtures/lf-line-endings.csv b/features/fixtures/lf-line-endings.csv index 682871ee..c8895ba7 100644 --- a/features/fixtures/lf-line-endings.csv +++ b/features/fixtures/lf-line-endings.csv @@ -1,2 +1,3 @@ "Foo","Bsr","Baz" "Biff","Baff","Boff" +"Qux","Teaspoon","Doge" \ No newline at end of file From d1eb0898249b6c041dea67def6f6f974e4603b71 Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 16:14:09 +0000 Subject: [PATCH 14/15] separate out quoting error types --- features/validation_errors.feature | 2 +- lib/csvlint/validate.rb | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/features/validation_errors.feature b/features/validation_errors.feature index db106465..7c5256a7 100644 --- a/features/validation_errors.feature +++ b/features/validation_errors.feature @@ -21,7 +21,7 @@ Feature: Get validation errors And it is stored at the url "http://example.com/example1.csv" When I ask if there are errors Then there should be 1 error - And that error should have the type "quoting" + And that error should have the type "unclosed_quote" And that error should have the row "1" And that error should have the content ""Foo","Bar","Baz" diff --git a/lib/csvlint/validate.rb b/lib/csvlint/validate.rb index 5a20bdc5..4f9afbda 100644 --- a/lib/csvlint/validate.rb +++ b/lib/csvlint/validate.rb @@ -7,9 +7,9 @@ class Validator attr_reader :encoding, :content_type, :extension, :headers ERROR_MATCHERS = { - "Missing or stray quote" => :quoting, + "Missing or stray quote" => :stray_quote, "Illegal quoting" => :whitespace, - "Unclosed quoted field" => :quoting, + "Unclosed quoted field" => :unclosed_quote, } def initialize(source, dialect = nil, schema = nil) @@ -92,7 +92,7 @@ def parse_csv(io) rescue CSV::MalformedCSVError => e wrapper.finished type = fetch_error(e) - if type == :quoting && wrapper.line.match(/[^\r]\n/) + if type == :stray_quote && !wrapper.line.match(csv.row_sep) build_errors(:line_breaks, :structure) else build_errors(type, :structure, current_line, nil, wrapper.line) @@ -109,7 +109,6 @@ def parse_csv(io) def fetch_error(error) - return :quoting if error.message.start_with?("Unquoted fields do not allow") e = error.message.match(/^([a-z ]+) (i|o)n line ([0-9]+)\.?$/i) ERROR_MATCHERS.fetch(e[1], :unknown_error) end From 39a423876cd69f48e8835541aedc3edd5471f5ad Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 12 Feb 2014 16:20:02 +0000 Subject: [PATCH 15/15] don't need to replace line endings any more in step --- features/step_definitions/parse_csv_steps.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/step_definitions/parse_csv_steps.rb b/features/step_definitions/parse_csv_steps.rb index 48509944..8569b0f6 100644 --- a/features/step_definitions/parse_csv_steps.rb +++ b/features/step_definitions/parse_csv_steps.rb @@ -1,5 +1,5 @@ Given(/^I have a CSV with the following content:$/) do |string| - @csv = string.gsub("\n", "\r\n") + @csv = string end Given(/^it is stored at the url "(.*?)"$/) do |url|