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

assertions.rb: AllFailures#message encoding

* test/lib/test/unit/assertions.rb (AllFailures#message): put
  indented messages back to the original encoding, to get rid of
  Encoding::CompatibilityError when key has non-ASCII characters.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-08-01 11:59:45 +00:00
parent 4eafec5ea6
commit ae6625c546

View file

@ -888,7 +888,8 @@ eom
total = @count.to_s
fmt = "%#{total.size}d"
@failures.map {|k, (n, v)|
"\n#{i+=1}. [#{fmt%n}/#{total}] Assertion for #{k.inspect}\n#{v.message.b.gsub(/^/, ' | ')}"
v = v.message
"\n#{i+=1}. [#{fmt%n}/#{total}] Assertion for #{k.inspect}\n#{v.b.gsub(/^/, ' | ').force_encoding(v.encoding)}"
}.join("\n")
end