Mutant has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I'm looking for a way of mocking a function that has been imported, e.g.
use Foo qw(bar); bar(%params); # <-- I want to mock this
bar() may also be imported implicitly. I know about fake_module(), but the code above will try to call import() on the mock object I've created. Do I have to mock import and somehow hook it into Exporter to export the actual function I want to mock?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Test::MockObject and imported functions
by chromatic (Archbishop) on Mar 13, 2008 at 18:06 UTC | |
|
Re: Test::MockObject and imported functions
by smerritt (Initiate) on Mar 14, 2008 at 03:22 UTC |