Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Test::MockModule and EXPORT

by jfroebe (Parson)
on May 26, 2015 at 17:02 UTC ( #1127858=perlquestion: print w/replies, xml ) Need Help??

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

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1127858]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2021-10-23 21:27 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (88 votes). Check out past polls.