From: Robert Feldt Date: 2006-12-03T11:52:15+09:00 Subject: Re: Why does a test fail when I predicted it's exception class? On 12/3/06, Richard wrote: > Hi, > > I have a test suite that invokes on test set that specifies > > assert_raise(ZeroDivisionError, MyCalc.new.calc) > > When I run the test suite, instead of "1 test, 0 failures, 0 errors", > I get the following. The code follows this output. > > What's up? > You are using assert_raise in the wrong way. The call you want to test must be wrapped in a block so that it's exception can be catched and compared to the expected one. Try something like assert_raise(RuntimeError) {raise ""} /Robert