Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2021-04-13 22:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?