From: chiaro scuro Date: 2006-03-06T08:59:15+09:00 Subject: Re: asserting in code vs unit tests I would get my assertions to raise exceptions too. They are just a specific kind of exception, related to the domain of inputs and outputs, different from exceptions generated from something that goes wrong in the middle. What do other people think about the relationship between assertions and exceptions? On 3/6/06, Pat Maddox wrote: > > tests alone however are never exhaustive and cannot prove correctness. > > assertions can catch some types of 'wrongness'. > > Isn't that what exceptions are for? > > def foo(a) > raise 'Argument can not be negative' if a < 0 > > b = something_that_should_always_be_positive > > raise 'Something strange happened and b was negative' if b < 0 > b > end -- -- Chiaroscuro -- Liquid Development: http://feeds.feedburner.com/LiquidDevelopment