From: Tom Clarke Date: 2003-01-10T06:52:18+09:00 Subject: Re: Adding hooks to TestUnit How about this: Module Web Module Testing add_pre_setup_hook { # do my initialization } end end So that add_pre_setup_hook is a method on TestCase, which will add one or more hooks (passed as a block) when called - in this case when the module is included. -Tom On Fri, Jan 10, 2003 at 05:37:24AM +0900, nathaniel@NOSPAMtalbott.ws wrote: > Tom Clarke [mailto:tom@u2i.com] wrote: > > > I need a way of performing an operation prior to the setup > > method being called before all tests where the Web::Testing > > module is included. > > > > Anyone know how I can do this, or does Test::Unit need to be enhanced? > > So basically you want to define some per-test setup that will be called > regardless of whether #setup is overriden? I don't think you can do that > currently. One work-around is to require that those using your module > call #super if they override #setup, which doesn't seem terribly > onerous. I will, however, add this request to the TODO and try to > determine if there's a good way to add it. > > > Nathaniel > > <:((>< > + - - > | RoleModel Software, Inc. > | EQUIP VI > > >