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