This queue is for tickets about the Module-Starter-PBP CPAN distribution.

Report information
The Basics
Id:
18293
Status:
open
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
steve.kirkup [...] dss.virginia.gov
Cc:
AdminCc:

BugTracker
Severity:
Normal
Broken in:
v0.0.3
Fixed in:
(no value)



Subject: perlcritic.t Template is incorrect
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 960
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.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.5.HEAD-19749-1143091958-544.18293-0-0@rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 733
Yeah, I would agree that this isn't quite right. Test::Perl::Critic 0.05 (which will be released this weekend) also allows you to configure Perl::Critic via the C<import> interface. So this is the template that I plan to put in the T:P:C documentation: #!perl use strict; use warnings; use English qw(-no_match_vars); use Test::More; eval { require Test::Perl::Critic; my @config = (); #Arguments for Perl::Critic->new() go here! Test::Perl::Critic->import( @config ); }; if( $EVAL_ERROR ) { plan( skip_all => 'Test::Perl::Critic required for PBP tests' ); } all_critic_ok(); I know its a bit verbose, but it is mostly to be compliant with Perl::Critic and PBP. Cheers. -Jeff


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.