http://www.perlmonks.org?node_id=1127858

jfroebe has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I'm trying to mock a module's subroutines that are exported using the Exporter module and @EXPORT. The problem I'm running into is Test::MockModule doesn't overload the subroutines in @EXPORT but will with @EXPORT_OK.

use_ok( 'Test::MockModule'); my $module = new Test::MockModule("silly::module"); # this works and overloads the export_ok_sub() $module->mock('export_ok_sub', sub { return }); # this doesn't overload the export_sub() $module->mock('export_sub', sub { return });

What am I missing? I know it is something simple.

Jason L. Froebe

Blog, Tech Blog