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

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
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