aboutsummaryrefslogtreecommitdiffstats
path: root/test/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-01 11:59:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-01 11:59:45 +0000
commit189e86334e3d13467bc334aeb4c80313978ef7d9 (patch)
tree03920a59956efb1b9e3d09d3fd9c86ad4c5242f0 /test/lib
parent5471e1d0606d3d14bbe674028205b637dadd8cf9 (diff)
downloadruby-189e86334e3d13467bc334aeb4c80313978ef7d9.tar.gz
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
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/test/unit/assertions.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/lib/test/unit/assertions.rb b/test/lib/test/unit/assertions.rb
index d426a3d844..d23cd7220b 100644
--- a/test/lib/test/unit/assertions.rb
+++ b/test/lib/test/unit/assertions.rb
@@ -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