From: Nathaniel Talbott Date: 2001-03-29T12:17:43+09:00 Subject: [ruby-talk:13305] RE: Request for additional Lapidary assert methods Duff O'Melia wrote: > jweirich@one.net [mailto:jweirich@one.net] wrote: > > > Also, I've found that providing the negative version of some the > > assertions is also helpful, e.g. assertNoMatch, assertNotNil, > > assertNoRaises. (The "assertNoRaises" is ackward, perhaps > > assertException and assertNoException would be a better pair.) > > > I think the following should be added to the framework: > # To do instance checks: > assertSame(expected, actual) > assertNotSame(expected, actual) > > # One negation jweirich brought up and one other: > assertNotEqual(expected, actual) > assertNotNil(object) > > > I'm unsure about the following being added: > - I can't remember ever testing code to *not* throw an exception. Has > anyone actually needed this? Therefore, I don't think the following method > should be added to the framework. > assertDoesNotRaise() > - I haven't used regular expressions much (yet) so I'm not > sure whether I'd use: > assertDoesNotMatch(regularExpression, string) OK, I agree with these (and they will be added): assertSame() assertNotSame() assertNotNil() assertNotEqual() I'll add assertNoMatch(), but if there's a better name for it, I'd be more excited about it. Is there a standard name for '!~' ? Finally, I really like the idea behind assertNoRaise(), but I REALLY don't like the name. Perhaps it would be OK, since this is slightly different in behavior from assertRaises() (since it doesn't need to take any arguments), to name it assertNoError() and break the name mirroring? Did I miss any of your suggestions? Thanks for the feedback, Nathaniel <:((>< + - - + - - | RoleModel Software, Inc. & | EQUIP VI | The XP Software Studio(TM) |