Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Testing of exception during importby Anonymous Monk |
on Jul 01, 2022 at 14:51 UTC ( [id://11145218]=note: print w/replies, xml ) | Need Help?? |
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'; ...
In Section
Seekers of Perl Wisdom
|
|