From: Eric Hodel Date: 2007-02-17T06:17:58+09:00 Subject: Re: [Test::Unit] Asserting exception messages? On Feb 16, 2007, at 11:36, Daniel Schierbeck wrote: > I've been looking around, but I haven't found a simple way of > asserting > that a raised exception has a specific message. RSpec can do this > quite > easily: > > lambda{ @fixture.foo }.should_raise(FooError, > 'out of foo, try our delicious bar instead!') So does Test::Unit. e = assert_raise BlahError do ... end assert_equal 'something', e.message