From: Louis J Scoras Date: 2006-12-03T11:52:41+09:00 Subject: Re: Why does a test fail when I predicted it's exception class? On 12/2/06, Richard wrote: > tc_TestSet.rb > ========== > require '.\BasicCalc.rb' > > class Test1 < Test::Unit::TestCase # The long-winded way > def test_excep > assert_raise(ZeroDivisionError, MyCalc.new.calc) > end > end You need to run the code that raises the exception in a block. assert_raise(ZeroDivisionError) { MyCalc.new.calc } should do the trick. -- Lou.