Subject: | perlcritic.t Template is incorrect |
The default perlcritic.t template has two problems,
if (!require Test::Perl::Critic) {
Test::More::plan( skip_all => "Test::Perl::Critic required for testing
PBP compliance" );
}
The first problem is that the require will display a message that it
cannot find the module in the @INC.
The second problem is that after the failure, Test::More has not 'used'
so it cannot call plan, generating another error.
My suggested for the template is,
eval 'use Test::Perl::Critic';
if ($@) {
eval 'Test::More';
plan( skip_all => "Test::Perl::Critic required for testing PBP
compliance" );
}
The first eval will not display a message if it is not installed. The
second eval is to load Test::More only if there is a problem with
Test::Perl::Critic. I did not want to load with 'use' if there is not a
problem.
I am also assuming that Test::More is installed on the local system
because that is what you use to test Module::Starter::PBP when it is
installed.