From: Robert Dober Date: 2010-06-04T00:00:38+09:00 Subject: Re: assert_raise question On Thu, Mar 9, 2006 at 3:29 AM, Jim Weirich wrote: > Eric Hodel wrote: >> For a given input a method should only raise one class of exception. >> The restriction forces you to write better tests. > > The reason I would like it is that the test is the specification of the > behavior.  I often wish to specify that a method will raise a more > general exception than the one it actually raises.  The actual exception > raised may be an implementation detail that I don't wish to have > expressed in the spec. > > -- > -- Jim Weirich There is no way you are wrong, thus you are both right :P. Personally I prefer rspec's behavior, also because it matches the semantics of "rescue". But I would like to raise a question myself - I just broke the record for the cheapest pun - why not have two different assertions for being able to test/specify two different things. Cheers R. > > -- > Posted via http://www.ruby-forum.com/. > > -- The best way to predict the future is to invent it. -- Alan Kay