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 reply to Re: Testing of exception during import
by Anonymous Monk
in thread Testing of exception during import
by Dirk80
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |