Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Testing of exception during import

by Anonymous Monk
on Jul 01, 2022 at 14:51 UTC ( #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? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2022-08-17 23:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?