File Coverage

blib/lib/Dist/Inkt/Role/Test/Kwalitee.pm
Criterion Covered Total %
statement 10 12 83.3
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 14 16 87.5


line stmt bran cond sub pod time code
1 1     1   729 use 5.010001;
  1         3  
  1         31  
2 1     1   5 use strict;
  1         1  
  1         27  
3 1     1   52 use warnings;
  1         2  
  1         72  
4              
5             package Dist::Inkt::Role::Test::Kwalitee;
6              
7             our $AUTHORITY = 'cpan:TOBYINK';
8             our $VERSION = '0.001';
9              
10 1     1   352 use Moose::Role;
  0            
  0            
11             use Types::Standard -types;
12             use namespace::autoclean;
13              
14             with qw(Dist::Inkt::Role::Test);
15              
16             has skip_kwalitee_test => (is => "ro", isa => Bool, default => 0);
17              
18             after BUILD => sub {
19             my $self = shift;
20            
21             $self->setup_tarball_test(sub {
22             my $tarball = $_[1];
23             require App::CPANTS::Lint;
24             my $app = App::CPANTS::Lint::->new(colour => 1);
25             my $res = $app->lint($tarball);
26             $app->output_report;
27             unless ($res or $self->skip_kwalitee_test) {
28             die "Needs more kwalitee";
29             }
30             });
31             };
32              
33             1;
34              
35             __END__
36              
37             =pod
38              
39             =encoding utf-8
40              
41             =head1 NAME
42              
43             Dist::Inkt::Role::Test::Kwalitee - check a distribution's kwalitee at build time
44              
45             =head1 DESCRIPTION
46              
47             After building a distribution tarball, check its kwalitee.
48              
49             =head1 BUGS
50              
51             Please report any bugs to
52             L<http://rt.cpan.org/Dist/Display.html?Queue=Dist-Inkt-Role-Test-Kwalitee>.
53              
54             =head1 SEE ALSO
55              
56             L<Dist::Inkt>, L<App::CPANTS::Lint>.
57              
58             =head1 AUTHOR
59              
60             Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
61              
62             =head1 COPYRIGHT AND LICENCE
63              
64             This software is copyright (c) 2014 by Toby Inkster.
65              
66             This is free software; you can redistribute it and/or modify it under
67             the same terms as the Perl 5 programming language system itself.
68              
69             =head1 DISCLAIMER OF WARRANTIES
70              
71             THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
72             WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
73             MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.