diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-05 08:33:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-05 08:33:38 +0000 |
commit | 80bedec6c25c82f2b37ecab5bab84576df52559c (patch) | |
tree | 36298efe09ac92a4d38602d57228da3bef4b629c /test/lib | |
parent | 5e3467c4414df815b3b00d2b0372026b069e7f7d (diff) | |
download | ruby-80bedec6c25c82f2b37ecab5bab84576df52559c.tar.gz |
assertions.rb: fallback encoding error
* test/lib/test/unit/assertions.rb (message): fallback when
outputs from different encoding commands mixed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/test/unit/assertions.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/lib/test/unit/assertions.rb b/test/lib/test/unit/assertions.rb index ca15bef720..936dcbf9f8 100644 --- a/test/lib/test/unit/assertions.rb +++ b/test/lib/test/unit/assertions.rb @@ -490,7 +490,11 @@ EOT if 1 < ary.length ary[0...-1] = ary[0...-1].map {|str| str.sub(/(?<!\.)\z/, '.') } end - ary.join("\n") + begin + ary.join("\n") + rescue Encoding::CompatibilityError + ary.map(&:b).join("\n") + end end else super |