diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-25 06:58:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-25 06:58:58 +0000 |
commit | d05217109fb5e909bbd7849bcc799b6404c7c8b0 (patch) | |
tree | 59c6e741e5c94660ea5860d745fffec33274121b /test/csv/test_encodings.rb | |
parent | 47a1cd1291f1f52cc8d36cb533e0d653d128930a (diff) | |
download | ruby-d05217109fb5e909bbd7849bcc799b6404c7c8b0.tar.gz |
* lib/csv.rb, test/csv: should not assume $, invariant.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/csv/test_encodings.rb')
-rwxr-xr-x[-rw-r--r--] | test/csv/test_encodings.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/csv/test_encodings.rb b/test/csv/test_encodings.rb index 82dca914fe..6681470097 100644..100755 --- a/test/csv/test_encodings.rb +++ b/test/csv/test_encodings.rb @@ -7,11 +7,9 @@ # Copyright 2008 James Edward Gray II. You can redistribute or modify this code # under the terms of Ruby's license. -require "test/unit" +require_relative "base" -require "csv" - -class TestEncodings < Test::Unit::TestCase +class TestCSV::Encodings < TestCSV def setup require 'tempfile' @temp_csv_file = Tempfile.new(%w"test_csv. .csv") @@ -225,7 +223,7 @@ class TestEncodings < Test::Unit::TestCase data = ["foo".force_encoding("US-ASCII"), "\u3042"] assert_equal("US-ASCII", data.first.encoding.name) assert_equal("UTF-8", data.last.encoding.name) - assert_equal("UTF-8", data.join.encoding.name) + assert_equal("UTF-8", data.join('').encoding.name) assert_equal("UTF-8", data.to_csv.encoding.name) end @@ -233,7 +231,7 @@ class TestEncodings < Test::Unit::TestCase data = ["foo".force_encoding("ISO-8859-1"), "\u3042"] assert_equal("ISO-8859-1", data.first.encoding.name) assert_equal("UTF-8", data.last.encoding.name) - assert_equal("UTF-8", data.join.encoding.name) + assert_equal("UTF-8", data.join('').encoding.name) assert_equal("UTF-8", data.to_csv.encoding.name) end @@ -260,9 +258,9 @@ class TestEncodings < Test::Unit::TestCase row_sep = (options[:row_sep] || "\n").encode(encoding) ary.map { |row| row.map { |field| - [quote_char, field.encode(encoding), quote_char].join + [quote_char, field.encode(encoding), quote_char].join('') }.join(col_sep) + row_sep - }.join.encode(encoding) + }.join('').encode(encoding) end def encode_for_tests(data, options = { }) @@ -276,4 +274,6 @@ class TestEncodings < Test::Unit::TestCase yield encoding end end + + with_diffrent_ofs end |