Re: how to run test.pl before the t/*.t tests ?

2004-06-19 Thread darren chamberlain
* Gabor Szabo [2004/06/18 23:34]: > I am trying to add a bunch of tests in t/ using Test::More but in > order to make sure we don't lose any previous test we would like to > keep the test.pl file as it is. Is porting the tests in test.pl to *.t files not an option? (darren) -- Never doubt that

testing for unsuccessful require - mocking require ?

2004-06-19 Thread Gabor Szabo
I would like to test a module for unsuccessful "require" while the required module is installed. That is I'd like ot test how my code would work if Foo.pm was not present. In the middle of a module I have code such as eval { require Foo; }; if ($@) { foo(); } else { my_own_foo(); } I a

Re: how to run test.pl before the t/*.t tests ?

2004-06-19 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, Gabor Szabo <[EMAIL PROTECTED]> wrote: > So first I thought to try to run test.pl before the t/-tests. Hence the > subject. How to do this is still interesting, though maybe not necessary: You used to be able to set the order of tests through MakeMaker, then that f

Re: testing for unsuccessful require - mocking require ?

2004-06-19 Thread Andrew Pimlott
On Sat, Jun 19, 2004 at 09:11:43PM -0200, Gabor Szabo wrote: > > I would like to test a module for unsuccessful "require" while the > required module is installed. That is I'd like ot test how my code would > work if Foo.pm was not present. > > In the middle of a module I have code such as > > e

Re: testing for unsuccessful require - mocking require ?

2004-06-19 Thread Fergal Daly
Below is Hide.pm, you can use it like this use Hide qw( Foo ); require Bar; # will be fine require Foo; # will fail I just wrote it now. It seems to work (even if @INC already contains subrefs, arrayrefs or objects). You can even use it twice and everything should just work. It seems to have a p

Re: testing for unsuccessful require - mocking require ?

2004-06-19 Thread Paul Johnson
On Sat, Jun 19, 2004 at 09:11:43PM -0200, Gabor Szabo wrote: > > I would like to test a module for unsuccessful "require" while the > required module is installed. That is I'd like ot test how my code would > work if Foo.pm was not present. > > In the middle of a module I have code such as > > e

Re: testing for unsuccessful require - mocking require ?

2004-06-19 Thread Kate L Pugh
On Sat 19 Jun 2004, Gabor Szabo <[EMAIL PROTECTED]> wrote: > I would like to test a module for unsuccessful "require" while the > required module is installed. That is I'd like ot test how my code would > work if Foo.pm was not present. Max Maischein wrote Test::Without::Module to do this. (This

Re: My Phalanx lightning talk

2004-06-19 Thread Mark Fowler
On Thu, 10 Jun 2004, Andy Lester wrote: > I'm thinking that maybe instead of people picking a module to do, and > then working on it, which has so far not worked at all, that we should > hold up a module (or a handful of them) and say "OK, this is what we're > working on". It certainly seemed to

Re: testing for unsuccessful require - mocking require ?

2004-06-19 Thread stevan little
Gabor, Maybe you could try using the [EMAIL PROTECTED] trick to do what you want? You could unshift a sub ref onto @INC right before the test which would mock the loading failure for Foo and only Foo. Then as soon as your test is finished, you can shift it back off again. unshift @INC => sub {