From: Matt Armstrong Date: 2003-02-07T12:01:41+09:00 Subject: Re: Return values from assertions Gavin Sinclair writes: > On Friday, February 7, 2003, 2:52:38 AM, Matt wrote: > >>> Matt Armstrong [mailto:matt@lickey.com] wrote: >> >> That hits the crux of my question -- the only practical difference >> between a failure and an error is that the error can have a nice error >> message? > > The conceptual difference is practical enough for me. > > Conceptual difference: > > - failure: specifically tested condition that, well, failed > - error: unexpected, uncaught exception > > If you expect that certain code will throw an exception, you test for > it and record a success or failure. If you don't expect an exception, > and you get one, then either your code or your test is seriously > wrong, in a different kind of way to a failed assertion. > > Therefore, failures and errors highlight different problems in the > code, and this is a practical difference. Even more to the point, I don't see a point to RubyUnit's assert_no_exception or Test::Unit's assert_nothing_raised. Conceptually, you're saying "this code shouldn't raise an exception that is not handled" but that is pretty much universally true. -- matt