* 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
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
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
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
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
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
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
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
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 {