ruby-changes:15948
From: usa <ko1@a...>
Date: Wed, 19 May 2010 18:10:57 +0900 (JST)
Subject: [ruby-changes:15948] Ruby:r27889 (trunk): * test/csv/test_interface.rb (test_write_hash): may need to set binary mode
usa 2010-05-19 18:10:45 +0900 (Wed, 19 May 2010) New Revision: 27889 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27889 Log: * test/csv/test_interface.rb (test_write_hash): may need to set binary mode when converter is specified. Modified files: trunk/test/csv/test_interface.rb Index: test/csv/test_interface.rb =================================================================== --- test/csv/test_interface.rb (revision 27888) +++ test/csv/test_interface.rb (revision 27889) @@ -167,14 +167,14 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/