summaryrefslogtreecommitdiff
path: root/spec/ruby/library/csv/parse_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/csv/parse_spec.rb')
-rw-r--r--spec/ruby/library/csv/parse_spec.rb16
1 files changed, 7 insertions, 9 deletions
diff --git a/spec/ruby/library/csv/parse_spec.rb b/spec/ruby/library/csv/parse_spec.rb
index 47d7ebbde1..7000f03cda 100644
--- a/spec/ruby/library/csv/parse_spec.rb
+++ b/spec/ruby/library/csv/parse_spec.rb
@@ -1,11 +1,11 @@
-require File.expand_path('../../../spec_helper', __FILE__)
+require_relative '../../spec_helper'
require 'csv'
describe "CSV.parse" do
it "parses '' into []" do
result = CSV.parse ''
- result.should be_kind_of(Array)
+ result.should.is_a?(Array)
result.should == []
end
@@ -82,14 +82,12 @@ describe "CSV.parse" do
it "raises CSV::MalformedCSVError exception if input is illegal" do
-> {
CSV.parse('"quoted" field')
- }.should raise_error(CSV::MalformedCSVError)
+ }.should.raise(CSV::MalformedCSVError)
end
- ruby_version_is '2.4' do
- it "handles illegal input with the liberal_parsing option" do
- illegal_input = '"Johnson, Dwayne",Dwayne "The Rock" Johnson'
- result = CSV.parse(illegal_input, liberal_parsing: true)
- result.should == [["Johnson, Dwayne", 'Dwayne "The Rock" Johnson']]
- end
+ it "handles illegal input with the liberal_parsing option" do
+ illegal_input = '"Johnson, Dwayne",Dwayne "The Rock" Johnson'
+ result = CSV.parse(illegal_input, liberal_parsing: true)
+ result.should == [["Johnson, Dwayne", 'Dwayne "The Rock" Johnson']]
end
end