diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-19 09:10:45 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-19 09:10:45 +0000 |
commit | 230ffa11d70c90ae1439b8953d8e3d343dc0582b (patch) | |
tree | 90a1944ac1dad210004273e39c2d8376da9d8bb3 /test/csv | |
parent | ec21e8438c5dcc5d77d8f353e66108aff524e987 (diff) | |
download | ruby-230ffa11d70c90ae1439b8953d8e3d343dc0582b.tar.gz |
* test/csv/test_interface.rb (test_write_hash): may need to set binary mode
when converter is specified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/csv')
-rw-r--r-- | test/csv/test_interface.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/csv/test_interface.rb b/test/csv/test_interface.rb index 04d0edc5f1..a58e9c6179 100644 --- a/test/csv/test_interface.rb +++ b/test/csv/test_interface.rb @@ -167,14 +167,14 @@ class TestCSVInterface < Test::Unit::TestCase File.unlink(@path) lines = [{a: 1, b: 2, c: 3}, {a: 4, b: 5, c: 6}] - CSV.open( @path, "w", headers: true, - header_converters: :symbol ) do |csv| + CSV.open( @path, "wb", headers: true, + header_converters: :symbol ) do |csv| csv << lines.first.keys lines.each { |line| csv << line } end - CSV.open( @path, "r", headers: true, - converters: :all, - header_converters: :symbol ) do |csv| + CSV.open( @path, "rb", headers: true, + converters: :all, + header_converters: :symbol ) do |csv| csv.each { |line| assert_equal(lines.shift, line.to_hash) } end end |