On Tue, Nov 12, 2002 at 01:31:43AM +0000, Mark Fowler wrote: > > Test::Builder->new would remain as a singleton. We'd just provide an > > alternate constructor to provide a second object if someone really wants it. > > You know, that would at the very least tidy up Test::Builder::Tester > somewhat. It's currently just a bit of a hack...(sssh, I didn't really > say that)
That's two votes. > > > > With two T::B objects, we could beat on one object while leaving > > > > another in a normal state to perform the tests. > > One day (maybe not this rewrite, maybe not the next) I'd like to see you > be able to write layers of tests. That is to say that you have some kind > of Test::Harness like system running actually inside a Test::Builder test > that runs another set of tests and returns "ok" or "not ok" if all *its* > tests returned "ok" or not. And then you could have subtests within that, > down to an arbitary level of abstraction. Does this make sense? Test::Harness::Straps->analyze* already do that if I understand you correctly. > Not that I'm one to break OO boundaries, but by allowing of breaking the > OO boundaries just a little bit by skipping the accessors you could just > do this, which means you are less likey to shoot yourself in the foot with > forgeting to reset the outputs back again. > > package Test::Builder::Log::like; > > my %outputs = map { ($_ => 'some_output.log') } qw(test failure todo); > sub like { > my ($self) = shift; > > local $self->{outputs} = \%outputs; > local $Test::Builder::Level = $Test::Builder::Level + 1; > > return $self->SUPER::like(@_) > } <Lament>Oh, to have real end-of-scope conditions.</Lament> > > > > The real reason why I put all the data into lexicals rather than a hash is > > > > because its easier to type $Have_Plan than $self->{Have_Plan}. > > http://magnonel.guild.net/~schwern/talks/Refactoring/slides/slide015.html > > ;-) The nice part about refactorings is they're reversable. -- Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/ Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One That which stirs me, stirs everything. -- Squonk Opera, "Spoon"