Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Test::MockModule and EXPORT

by jfroebe (Parson)
on May 26, 2015 at 17:02 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-24 21:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found