summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/test/unit.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index fddc994e6..14ddc08f2 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -102,6 +102,16 @@ module Test
exp_comment = " (nsec=#{exp.nsec})"
act_comment = " (nsec=#{act.nsec})"
end
+ elsif !Encoding.compatible?(exp_str, act_str)
+ if exp.is_a?(String) && act.is_a?(String)
+ exp_str = exp.dump
+ act_str = act.dump
+ exp_comment = " (#{exp.encoding})"
+ act_comment = " (#{act.encoding})"
+ else
+ exp_str = exp_str.dump
+ act_str = act_str.dump
+ end
end
"<#{exp_str}>#{exp_comment} expected but was\n<#{act_str}>#{act_comment}"
}