On 2/23/07, A. Pagaltzis <[EMAIL PROTECTED]> wrote:

* Dominique Quatravaux <[EMAIL PROTECTED]> [2007-02-23 11:35]:
> And, uh, how about this:
>
> use lib 't';
> use mock::LWP::Simple;

That will not call the importer in the right package.


To expand on this answer, without funky voodoo, after loading
mock::LWP::Simple perl won't think it had loaded LWP::Simple.  So later if
your module under test does 'use LWP::Simple', perl will load the real one.


Your approach does work when you're creating mock objects that are passed
into other objects, though.

Cheers,
Luke

Reply via email to