blib/lib/Dist/Zilla/Plugin/NoAutomatedTesting.pm

filter: Statementstmt 55.0% 11 / 20 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 2 / 3 Podpod 100% 1 / 1 totaltotal 45.1% 14 / 31 CC 4 SCAR 26.1
CC
4
Cov
44%
setup_installer
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 13.7
↑ Summary
1 package Dist::Zilla::Plugin::NoAutomatedTesting;
2 {
3 1 $Dist::Zilla::Plugin::NoAutomatedTesting::VERSION = '0.08';
4 }
5  
6 # ABSTRACT: Avoid running under CPAN Testers
7  
8 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 with 'Dist::Zilla::Role::InstallTool';
10  
11 0 ▶sub setup_installer {
Subroutine setup_installer: not called CC=4 SCAR=30.0
Pod documented
12 0 my $self = shift;
13  
14 0 ▶ my @build_files = grep { $_->name eq 'Makefile.PL' or $_->name eq 'Build.PL' } @{ $self->zilla->files };
Condition0%0/3
$_->name eq 'Makefile.PL' || $_->name eq 'Build.PL'
l!l&&r!l&&!r
000
MC/DC0%0/2
$_->name eq 'Makefile.PL' || $_->name eq 'Build.PL'
$_->name eq 'Makefile.PL' $_->name eq 'Build.PL'
Truth table0%0/3
A || B
A= $_->name eq 'Makefile.PL'B= $_->name eq 'Build.PL'
ABresult
1X1
011
000
15  
16 0 ▶ $self->log_fatal('No Makefile.PL or Build.PL was found. [NoAutomatedTesting] should appear in dist.ini after your installer plugin!')
Branch: 1 branch
BranchTrueFalseTotal
unless @build_files 0 0 0
17 unless @build_files;
18  
19 0 my $content = 'exit 0 if $ENV{AUTOMATED_TESTING};' . "\n";
20 0 foreach my $file (@build_files)
21 {
22 0 $file->content( $content . $file->content );
23 }
24 0 return;
25 }
26  
27 1 __PACKAGE__->meta->make_immutable;
28 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 1 'NO SMOKING'
31  
32 __END__
↑ Summary