diff options
author | jeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-23 14:59:25 +0000 |
---|---|---|
committer | jeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-23 14:59:25 +0000 |
commit | 1bd1128989a339790a658c43ec3d9769b49265da (patch) | |
tree | 6efae89644fcd74cdab3f28209243b8e9c057cf1 /test/csv/test_interface.rb | |
parent | 0471422beb4d786ede528612c8486296761a59ee (diff) | |
download | ruby-1bd1128989a339790a658c43ec3d9769b49265da.tar.gz |
* lib/csv.rb: Incorporating the fixes from the recent
FasterCSV releases: 1.5.2 and 1.5.3. [ruby-core:25038]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/csv/test_interface.rb')
-rw-r--r-- | test/csv/test_interface.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/csv/test_interface.rb b/test/csv/test_interface.rb index 5aedbbb075..04d0edc5f1 100644 --- a/test/csv/test_interface.rb +++ b/test/csv/test_interface.rb @@ -75,6 +75,11 @@ class TestCSVInterface < Test::Unit::TestCase assert_equal(%w{1 2 3}, row) end + def test_parse_line_with_empty_lines + assert_equal(nil, CSV.parse_line("")) # to signal eof + assert_equal(Array.new, CSV.parse_line("\n1,2,3")) + end + def test_read_and_readlines assert_equal( @expected, CSV.read(@path, col_sep: "\t", row_sep: "\r\n") ) @@ -167,7 +172,7 @@ class TestCSVInterface < Test::Unit::TestCase csv << lines.first.keys lines.each { |line| csv << line } end - CSV.open( @path, "w", headers: true, + CSV.open( @path, "r", headers: true, converters: :all, header_converters: :symbol ) do |csv| csv.each { |line| assert_equal(lines.shift, line.to_hash) } |