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
This commit is contained in:
nobu 2015-12-05 08:33:38 +00:00
parent 5e3467c441
commit 80bedec6c2

View File

@ -490,7 +490,11 @@ EOT
if 1 < ary.length if 1 < ary.length
ary[0...-1] = ary[0...-1].map {|str| str.sub(/(?<!\.)\z/, '.') } ary[0...-1] = ary[0...-1].map {|str| str.sub(/(?<!\.)\z/, '.') }
end end
begin
ary.join("\n") ary.join("\n")
rescue Encoding::CompatibilityError
ary.map(&:b).join("\n")
end
end end
else else
super super