Let's assume I have a module which needs 3 import parameters.
my $class = shift;
croak "Number of import parameters is wrong, stopped " unless @_ =
The good case I can check with use_ok. But the bad cases are my problem, e.g. use this class with less than 3 parameters.
use My::Test "Param1", "Param2"; # dies because it are 2 params and no
+t 3 as expected
I want to test that this exception was thrown and I also want to check its error message for correctness. Usually I use throws_ok for this. But in this case it doesn't work because the use command is at compile time. I have no idea how to test for this exception.
Thanks for your help!