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:
parent
2ac5cdd07a
commit
066b30245b
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue