1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

rescue Encoding::ConverterNotFoundError.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2009-08-16 06:31:31 +00:00
parent 2ac5cdd07a
commit 066b30245b

View file

@ -197,8 +197,12 @@ class TestEncodings < Test::Unit::TestCase
def test_can_write_csv_in_any_encoding
each_encoding do |encoding|
# test generate_line with encoding hint
csv = %w[abc d|ef].map { |f| f.encode(encoding) }.
to_csv(col_sep: "|", encoding: encoding.name)
begin
csv = %w[abc d|ef].map { |f| f.encode(encoding) }.
to_csv(col_sep: "|", encoding: encoding.name)
rescue Encoding::ConverterNotFoundError
next
end
assert_equal(encoding, csv.encoding)
# test generate_line with encoding guessing from fields