Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Testing of exception during import

by Anonymous Monk
on Jul 01, 2022 at 14:51 UTC ( [id://11145218]=note: print w/replies, xml ) Need Help??


in reply to Testing of exception during import

FWIW, I would either use My::Test (); or require My::Test;. Both load the module without calling its import() method at all. Then call the import method explicitly:


use Test::Exception;
use My::Test ();

lives_ok { My::Test->import( 1, 2, 5 ) }, 'Three parameters';
throws_ok { My::Test->import( 1, 2 ) } m/Number of import parameters is wrong/, 'Two parameters';
...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11145218]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-18 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found