sUnit- testing for a specific error
Ned Konz
ned at bike-nomad.com
Sun May 11 18:10:01 UTC 2003
On Sunday 11 May 2003 10:57 am, Stephane Ducasse wrote:
> why what I was syaing was wrong? If I do should: [] raise: MyError
> this is not working?
I thought that Anthony wanted to be more specific. He can't define
MyError if he's looking for a pre-existing Error that's already being
raised by another (pre-written) class. So he has to look at both the
class of the error (Error) and its description ("is not in the
collection").
Certainly if you have a predictable error class that actually *means*
something (as opposed to the widespread use of Error for all kinds of
things in the image), you should look for the class instead.
> On Sunday, May 11, 2003, at 07:40 PM, Ned Konz wrote:
> > On Sunday 11 May 2003 09:53 am, Anthony Adachi wrote:
> >> ...The error thrown should be: "Error: Object is not
> >> in the collection.". However, the code above only
> >> checks for a generic Error.
> >>
> >> Is it even possible for sUnit to check if a specific
> >> error has occurred rather than just testing that any
> >> kind of error has occurred?
> >
> > Well, the problem is that many things are just raising Error.
> >
> > I just posted a CS that lets you also test the exception
> > description for a substring.
> >
> > --
> > Ned Konz
> > http://bike-nomad.com
> > GPG key ID: BEEA7EFE
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|