Swap CAG with Moo, lazify a lot of the profile selection
[dbsrgits/SQL-Abstract.git] / xt / 91podcoverage.t
CommitLineData
428975b0 1use warnings;
2use strict;
3
13fb11fd 4use Test::More;
5
6eval "use Pod::Coverage 0.19";
7plan skip_all => 'Pod::Coverage 0.19 required' if $@;
8eval "use Test::Pod::Coverage 1.04";
9plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
10
11plan skip_all => 'set TEST_POD to enable this test'
12 unless ( $ENV{TEST_POD} || -e 'MANIFEST.SKIP' );
13
14my @modules = sort { $a cmp $b } ( Test::Pod::Coverage::all_modules() );
13fb11fd 15
16# Since this is about checking documentation, a little documentation
17# of what this is doing might be in order...
18# The exceptions structure below is a hash keyed by the module
19# name. The value for each is a hash, which contains one or more
20# (although currently more than one makes no sense) of the following
21# things:-
22# skip => a true value means this module is not checked
23# ignore => array ref containing list of methods which
24# do not need to be documented.
25my $exceptions = {
26 'SQL::Abstract' => {
27 ignore => [
28 qw/belch
29 puke/
30 ]
31 },
c54740ba 32 'SQL::Abstract::Tree' => { ignore => [qw(BUILDARGS)] },
13fb11fd 33 'SQL::Abstract::Test' => { skip => 1 },
72935ffc 34 'DBIx::Class::Storage::Debug::PrettyPrint' => { skip => 1 },
13fb11fd 35};
36
37foreach my $module (@modules) {
38 SKIP:
39 {
40 skip "$module - No user visible methods",
41 1
42 if ( $exceptions->{$module}{skip} );
43
44 # build parms up from ignore list
45 my $parms = {};
46 $parms->{trustme} =
47 [ map { qr/^$_$/ } @{ $exceptions->{$module}{ignore} } ]
48 if exists( $exceptions->{$module}{ignore} );
49
50 # run the test with the potentially modified parm set
51 pod_coverage_ok( $module, $parms, "$module POD coverage" );
52 }
53}
10e6c946 54
55done_testing;