Re: More Test::Builder::Test stuff

2002-02-17 Thread Mark Fowler

On Sun, 17 Feb 2002, Mark Fowler wrote:

> I'd really like to see that it still works on a system that 
> doesn't have Term::ANSIColor installed on it (it should turn colouring 
> into a no-op and skip tests, but I can't test that.)  

D'Oh!  No it shouldn't.  As color should work (just without colouring) on 
systems that don't have Term::ANSIColor installed then the tests shouldn't 
be skipped at all, they should be carried out to explicitly check that 
then still work without it.

Code updated so that it should do just that.

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}




Re: More Test::Builder::Test stuff

2002-02-21 Thread Nicholas Clark

On Sun, Feb 17, 2002 at 02:00:06PM +, Mark Fowler wrote:
> On Sun, 17 Feb 2002, Mark Fowler wrote:
> 
> > I'd really like to see that it still works on a system that 
> > doesn't have Term::ANSIColor installed on it (it should turn colouring 
> > into a no-op and skip tests, but I can't test that.)  
> 
> D'Oh!  No it shouldn't.  As color should work (just without colouring) on 
> systems that don't have Term::ANSIColor installed then the tests shouldn't 
> be skipped at all, they should be carried out to explicitly check that 
> then still work without it.
> 
> Code updated so that it should do just that.

I think that if you have enough disk space you should be able to build
yourself a second perl install that doesn't have Term::ANSIColor installed,
by configuring perl to use a different prefix and ensuring it doesn't have any
of the "standard" places to find libraries in INC.

Alternatively, if your Term::ANSIColor is installed in 5.6.1's directories,
just build yourself a 5.005_03 in the regular place :-)

Nicholas Clark
-- 
EMCFT http://www.ccl4.org/~nick/CV.html



Re: More Test::Builder::Test stuff

2002-02-21 Thread Michael G Schwern

On Thu, Feb 21, 2002 at 12:52:01PM +, Nicholas Clark wrote:
> On Sun, Feb 17, 2002 at 02:00:06PM +, Mark Fowler wrote:
> > On Sun, 17 Feb 2002, Mark Fowler wrote:
> > 
> > > I'd really like to see that it still works on a system that 
> > > doesn't have Term::ANSIColor installed on it (it should turn colouring 
> > > into a no-op and skip tests, but I can't test that.)  
> > 
> > D'Oh!  No it shouldn't.  As color should work (just without colouring) on 
> > systems that don't have Term::ANSIColor installed then the tests shouldn't 
> > be skipped at all, they should be carried out to explicitly check that 
> > then still work without it.
> > 
> > Code updated so that it should do just that.
> 
> I think that if you have enough disk space you should be able to
> build yourself a second perl install that doesn't have
> Term::ANSIColor installed, by configuring perl to use a different
> prefix and ensuring it doesn't have any of the "standard" places to
> find libraries in INC.

Simpler thing to do would be to create t/lib/fake/Term/ANSIColor.pm
which is something like:

package Term::ANSIColor;
die, die, die, die, die "Can't locate Term/ANSIColor.pm in \@INC\n";

and then when you want to simulate not having Term::ANSIColor in the
tests you can do:

unshift @INC, 't/lib/fake';
...

and any unshielded require/use of Term::ANSIColor will explode
convincingly.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
"Let's face it," said bearded Rusty Simmons, opening a can after the
race.  "This is a good excuse to drink some beer."  At 10:30 in the
morning?  "Well, it's past noon in Dublin," said teammate Mike
[Joseph] Schwern.  "It's our duty."
-- "Sure, and It's a Great Day for Irish Runners" 
   Newsday, Sunday, March 20, 1988



Re: More Test::Builder::Test stuff

2002-02-21 Thread Michael G Schwern

On Thu, Feb 21, 2002 at 10:05:09AM -0500, Michael G Schwern wrote:
> Simpler thing to do would be to create t/lib/fake/Term/ANSIColor.pm
> which is something like:
> 
> package Term::ANSIColor;
> die, die, die, die, die "Can't locate Term/ANSIColor.pm in \@INC\n";

Sorry, that should be:

die die kill kill die die die kill die 
"Can't locate Term/ANSIColor.pm in \@INC (\@INC contains: @INC)";

:)

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
Obscenity is the last resort of the illiterate, Mother Fucker
-- KAL