From a0b15459ef32d644a33565aed8bea06c19c4f0e9 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 31 Jan 2009 13:51:46 +0000 Subject: * lib/test/unit/assertions.rb (assert_equal): show class in failure message if meaningful. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/test/unit/assertions.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index 5987d1adc7..2e9fadfe57 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -69,6 +69,10 @@ module Test elsif exp.is_a?(Time) && act.is_a?(Time) exp_comment = " (nsec=#{exp.nsec})" act_comment = " (nsec=#{act.nsec})" + elsif exp.class != act.class + # a subclass of Range, for example. + exp_comment = " (#{exp.class})" + act_comment = " (#{act.class})" end elsif !Encoding.compatible?(exp_str, act_str) if exp.is_a?(String) && act.is_a?(String) -- cgit v1.2.3