From: Nathaniel Talbott Date: 2002-03-16T09:54:06+09:00 Subject: RE: testunit - setup -> set_up ? Ron Jeffries [mailto:ronjeffries@REMOVEacm.org] wrote: > On Fri, 15 Mar 2002 02:10:16 GMT, "Nathaniel Talbott" > wrote: > > >> In message "RE: testunit - setup -> set_up ?" > >> on 02/03/14, "Nathaniel Talbott" writes: > >> > >> |Ah, but JUnit uses setUp... two words. So which is the "xUnit way?" > >> > >> I just miss "setup" just for its conciseness. > > > >Woah... pressure comes to bear ;-) > > Doesn't sUnit use setup? I have no earthly idea if it does now, but looking at Kent's original write-up (http://www.xprogramming.com/testfram.htm), it originally used setUp. > >To avoid more floundering, let me bring up a couple of other name > >changes I'm pondering: > > > >#assert_raises -> #assert_raised > >#assert_nothing_raised -> #assert_not_raised > >#assert_throws -> #assert_thrown > >#assert_nothing_thrown -> #assert_not_thrown > > in many cases I might just allow either, but that's a style > that some disagree with. I would be one of them, at least at this time and in this place. > assert_raises seems right to me because the next thing is the > name of the exception. Interesting... this for me touches on the whole #assert_equal vs. #assert_equals thing, and has to do with how we read code. In Smalltalk, I would say, assert: aBlock raises: anExceptionList At least, if I wrote Smalltalk, I think that's what I'd say. However, in Ruby, all the arguments are at the end: assert_raised(*args) {} So for me, the sentence in Ruby reads more like, "Assert that these exceptions are thrown by this block: exceptions, block". Does anyone else read code like this? Perhaps the different sentence perception has to do with your Smalltalk background and my Java one? Am I stuck on an issue that doesn't really matter? I'm decided on #assert_equal. I'm still not sure about #assert_raised. I'm glad to be convinced one way or the other. > assert_nothing_raised seems right because the next thing is > /not/ the name of an exception. False. Exceptions can be specified as arguments to the method, and if they are, only those exceptions are rescued. Does that change your mind? > Ditto the throwns. I wonder if the behavior and naming of the assertions for exceptions and signals should be symmetrical. Currently #assert_nothing_thrown does not allow the specification of specific signals to be caught in the way #assert_nothing_raised does for exceptions. If it did, I'd definitely keep the names symmetrical. If it stays the same, I'll probably break the naming symmetry as a small mnemonic of the behavioral difference. > >I'll keep thinking about #setup vs. #set_up, and get back to ya'll. > > Get it right, Nathaniel, this one is for the species! I've been through enough iterations of it to hopefully be getting close :-) Nathaniel <:((>< + - - | RoleModel Software, Inc. | EQUIP VI