* lib/csv.rb: Fixed test failures caused by changes to Ruby.

* test/csv/tc_serialization, test/csv/tc_csv_parsing, test/csv/tc_features:
  Fixed test failures caused by changes to Ruby.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
jeg2 2007-12-25 05:14:04 +00:00
parent 33a071016b
commit a2443bdcf9
5 changed files with 21 additions and 10 deletions

View file

@ -123,7 +123,7 @@ class TestCSVParsing < Test::Unit::TestCase
line,4,some\rjunk
line,5,jkl
END_DATA
lines = bad_data.to_a
lines = bad_data.lines.to_a
assert_equal(6, lines.size)
assert_match(/\Aline,4/, lines.find { |l| l =~ /some\rjunk/ })
@ -147,7 +147,7 @@ class TestCSVParsing < Test::Unit::TestCase
line,4,8'10"
line,5,jkl
END_DATA
lines = bad_data.to_a
lines = bad_data.lines.to_a
assert_equal(6, lines.size)
assert_match(/\Aline,4/, lines.find { |l| l =~ /8'10"/ })

View file

@ -82,7 +82,7 @@ class TestCSVFeatures < Test::Unit::TestCase
end
def test_lineno
assert_equal(5, @sample_data.to_a.size)
assert_equal(5, @sample_data.lines.to_a.size)
4.times do |line_count|
assert_equal(line_count, @csv.lineno)

View file

@ -13,7 +13,7 @@ require "csv"
# An example of how to provide custom CSV serialization.
class Hash
def self.csv_load( meta, headers, fields )
self[*headers.zip(fields).flatten.map { |e| eval(e) }]
self[*headers.zip(fields).to_a.flatten.map { |e| eval(e) }]
end
def csv_headers