File Coverage

blib/lib/Dist/Inkt/Role/Test/Whitespace.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 23 23 100.0


line stmt bran cond sub pod time code
1 1     1   1076749 use 5.010001;
  1         3  
2 1     1   6 use strict;
  1         2  
  1         21  
3 1     1   4 use warnings;
  1         3  
  1         87  
4              
5             package Dist::Inkt::Role::Test::Whitespace;
6              
7             our $AUTHORITY = 'cpan:TOBYINK';
8             our $VERSION = '0.024';
9              
10 1     1   10 use Moose::Role;
  1         3  
  1         10  
11 1     1   5193 use Types::Standard "Bool";
  1         3  
  1         11  
12 1     1   548 use File::chdir;
  1         2  
  1         312  
13              
14             with qw(Dist::Inkt::Role::Test);
15              
16             has skip_whitespace_test => (is => "ro", isa => Bool, default => 0);
17              
18             after BUILD => sub {
19             my $self = shift;
20            
21             $self->setup_prebuild_test(sub {
22             return if $self->skip_whitespace_test;
23             local $CWD = $self->rootdir;
24             my @dirs = grep -d, qw( lib bin t xt );
25            
26             $self->log("Testing with Test::EOL");
27             die("Bad whitespace")
28             if system("perl -MTest::EOL -E'all_perl_files_ok(qw/ @dirs /)'");
29            
30             $self->log("Testing with Test::Tabs");
31             die("Bad whitespace")
32             if system("perl -MTest::Tabs -E'all_perl_files_ok(qw/ @dirs /)'");
33             });
34             };
35              
36             1;