summaryrefslogtreecommitdiff
path: root/test/csv
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-25 07:04:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-25 07:04:38 +0000
commitb4876f5e0422e020d617b77145a492c5bc327f08 (patch)
tree53a232de142804533aa235f9a34b6add1c829a88 /test/csv
parentd05217109fb5e909bbd7849bcc799b6404c7c8b0 (diff)
* lib/csv.rb (CSV::foreach, CSV#initialize): directly use encoding
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/csv')
-rwxr-xr-xtest/csv/test_encodings.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/csv/test_encodings.rb b/test/csv/test_encodings.rb
index 6681470..0f2ec12 100755
--- a/test/csv/test_encodings.rb
+++ b/test/csv/test_encodings.rb
@@ -154,10 +154,9 @@ class TestCSV::Encodings < TestCSV
def test_foreach_allows_you_to_set_encodings
encode_for_tests([%w[abc def]]) do |data|
# read and write in encoding
- File.open(@temp_csv_path, "wb:#{data.encoding.name}") { |f| f << data }
- CSV.foreach(@temp_csv_path, encoding: data.encoding.name) do |row|
- assert( row.all? { |f| f.encoding == data.encoding },
- "Wrong data encoding." )
+ File.open(@temp_csv_path, "wb", encoding: data.encoding) { |f| f << data }
+ CSV.foreach(@temp_csv_path, encoding: data.encoding) do |row|
+ row.each {|f| assert_equal(f.encoding, data.encoding)}
end
# read and write with transcoding