From: nathaniel@... Date: 2003-01-10T11:33:55+09:00 Subject: Re: Adding hooks to TestUnit Dmitri Colebatch [mailto:dim@colebatch.com] wrote: > hehe... "thankfully" (o: I suppose this is one of the > differences between a static and a dynamic language (the > reason I'm playing with ruby is to explore the > benefits/tradeoffs of static vs dynamic languages).. I'd say that this is one of the key advantages of dynamic languages over static ones, but I'm sure there others who would disagree with me :-) > anyway, using finally, I would do this: > > module MyTestModule > 'final' def setup > # other setup stuff that needs to be done. > doSetup > end > def doSetup > # dont force them to do anything > end > end > > does that work? to be honest I hadn't clicked that this is > at the module level and not the class level - so I may be > missing something obvious.... haven't got my head around how > module polymorphism works yet.... (is that the correct terminology?) OK, I see what you're getting at, but I don't think you'd want to do that (not that you could anyway, because there is no final) because then those using MyTestModule have to learn a new syntax for setup (i.e. doSetup) that's different than the already-familiar Test::Unit syntax. Nathaniel <:((>< + - - | RoleModel Software, Inc. | EQUIP VI