On Thu, Jul 08, 2004 at 08:59:38PM +0100, Fergal Daly wrote:
> On Thu, Jul 08, 2004 at 01:59:35PM -0400, Michael G Schwern wrote:
> > Likely you'd control if you wanted this behavior with 
> > HARNESS_PERL_SWITCHES=-MTest::AutoDebug
> > 
> > This can be implemented, currently, by adding a post hook onto 
> > Test::Builder->ok() with Hook::LexWrap or Sub::Uplevel.  I'm considering
> > future versions of Test::Builder to offer some sort of event subscriber
> > system so people can more easily do this sort of thing.
> 
> The debugger thing sounds very nice but rather than event hooks, why not use
> OO.

With inheritence, only one variant can be used at a time.

With event subscribers, lots of variants can be used at a time.

Consider what happens when you want to use Test::AutoDebug and a hypothetical
module which colors failure diagnostics.  If they're both implemented as their 
own Test::Builder subclasses only one can be in operation at a time.  With
an event model they're just hooking into the existing object and can
both be informed of an event and take whatever action they like.


-- 
Michael G Schwern        [EMAIL PROTECTED]  http://www.pobox.com/~schwern/
"That's what Jagulars always do," said Pooh, much interested.  "They call
'Help! Help!' and then when you look up they drop down on you."

Reply via email to