Well how about them apples?! Add temporary overload-madness escape hatch
[dbsrgits/SQL-Abstract.git] / xt / 91podcoverage.t
1 use warnings;
2 use strict;
3
4 use Test::More;
5
6 eval "use Pod::Coverage 0.19";
7 plan skip_all => 'Pod::Coverage 0.19 required' if $@;
8 eval "use Test::Pod::Coverage 1.04";
9 plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
10
11 plan skip_all => 'set TEST_POD to enable this test'
12   unless ( $ENV{TEST_POD} || -e 'MANIFEST.SKIP' );
13
14 my @modules = sort { $a cmp $b } ( Test::Pod::Coverage::all_modules() );
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.
25 my $exceptions = {
26     'SQL::Abstract' => { ignore => [qw(
27       belch
28       puke
29       DETECT_AUTOGENERATED_STRINGIFICATION
30     )]},
31     'SQL::Abstract::Tree' => { ignore => [qw(BUILDARGS)] },
32     'SQL::Abstract::Test' => { skip => 1 },
33     'DBIx::Class::Storage::Debug::PrettyPrint' => { skip => 1 },
34 };
35
36 foreach my $module (@modules) {
37   SKIP:
38     {
39         skip "$module - No user visible methods",
40           1
41           if ( $exceptions->{$module}{skip} );
42
43         # build parms up from ignore list
44         my $parms = {};
45         $parms->{trustme} =
46           [ map { qr/^$_$/ } @{ $exceptions->{$module}{ignore} } ]
47           if exists( $exceptions->{$module}{ignore} );
48
49         # run the test with the potentially modified parm set
50         pod_coverage_ok( $module, $parms, "$module POD coverage" );
51     }
52 }
53
54 done_testing;