move xt tests to xt/author for Module::Install to work
[gitmo/MooseX-Singleton.git] / xt / author / pod-coverage.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8 eval "use Test::Pod::Coverage 1.04";
9 plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@;
10
11 # This is a stripped down version of all_pod_coverage_ok which lets us
12 # vary the trustme parameter per module.
13 my @modules = all_modules();
14 plan tests => scalar @modules;
15
16 my %trustme = (
17     'MooseX::Singleton' => ['init_meta'],
18     'MooseX::Singleton::Role::Meta::Class' =>
19         [qw( clear_singleton existing_singleton )],
20     'MooseX::Singleton::Role::Meta::Instance' => ['get_singleton_instance'],
21     'MooseX::Singleton::Role::Object'         => [qw( initialize instance )],
22 );
23
24 for my $module ( sort @modules ) {
25     my $trustme = [];
26     if ( $trustme{$module} ) {
27         my $methods = join '|', @{ $trustme{$module} };
28         $trustme = [qr/^(?:$methods)$/];
29     }
30
31     pod_coverage_ok(
32         $module, { trustme => $trustme },
33         "Pod coverage for $module"
34     );
35 }