more convert to using Test::Requires
[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 use Test::Requires {
9     'Test::Pod::Coverage' => '1.04', # skip all if not installed
10 };
11
12 # This is a stripped down version of all_pod_coverage_ok which lets us
13 # vary the trustme parameter per module.
14 my @modules = all_modules();
15 plan tests => scalar @modules;
16
17 my %trustme = (
18     'MooseX::Singleton' => ['init_meta'],
19     'MooseX::Singleton::Role::Meta::Class' =>
20         [qw( clear_singleton existing_singleton )],
21     'MooseX::Singleton::Role::Meta::Instance' => ['get_singleton_instance'],
22     'MooseX::Singleton::Role::Object'         => [qw( initialize instance )],
23 );
24
25 for my $module ( sort @modules ) {
26     my $trustme = [];
27     if ( $trustme{$module} ) {
28         my $methods = join '|', @{ $trustme{$module} };
29         $trustme = [qr/^(?:$methods)$/];
30     }
31
32     pod_coverage_ok(
33         $module, { trustme => $trustme },
34         "Pod coverage for $module"
35     );
36 }