From: jweirich@... Date: 2001-03-25T14:43:34+09:00 Subject: [ruby-talk:13191] Re: Request for additional Lapidary assert methods >>>>> "Duff" == Duff O'Melia writes: Duff> The following assert methods have been very helpful to me in Duff> the past when using JUnit. [...] I think the following Duff> should be added to the framework: Duff> # To do instance checks: Duff> assertSame(expected, actual) Duff> assertNotSame(expected, actual) What's the difference between Same and Equal? Duff> # One negation jweirich brought up and one other: Duff> assertNotEqual(expected, actual) Duff> assertNotNil(object) Yes. Duff> I'm unsure about the following being added: Duff> - I can't remember ever testing code to *not* throw an Duff> exception. Has anyone actually needed this? Therefore, I Duff> don't think the following method should be added to the Duff> framework. Duff> assertDoesNotRaise() I've done it, although not often. I was checking that a framework supported X, but threw an exception on Y. In retrospect, I could have used any old assertion to check for X support, in which case the test would have had an error (rather than failing the assertion ... a subtle difference). Duff> - I haven't used regular expressions much (yet) so I'm not Duff> sure whether I'd use: Duff> assertDoesNotMatch(regularExpression, string) I've used this when testing regular expressions, e.g. asserting that the RE matches these strings and does not match these other strings. -- -- Jim Weirich jweirich@one.net http://w3.one.net/~jweirich --------------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)