From: Gavin Sinclair Date: 2003-02-26T17:03:32+09:00 Subject: Re: Comparing strings and integers in Test::Unit On Tuesday, February 25, 2003, 3:16:58 AM, Paul wrote: > It's not immediately obvious why <10> is not equal to <10>. > 1) Is there anything I can do to get a more useful assertion failure > message? One time when this bit me, I did the following (assuming variables and ): redefine expected, actual assert_equal(expected, actual) ... def redefine(*args) args.each do |obj| def obj.to_s inspect # or some user-defined output end end end In other words, I redefined the #to_s method for the expected and actual objects so that #inspect was called instead. I like Brian's idea that assert_equal should produce a more intelligent error message if the two objects are not equal but produce equal strings. Gavin