ac1561b2fb02aaa4e0139503a41f575de4b1531c
[gitmo/Moose.git] / xt / 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     'Moose'                  => ['make_immutable'],
18     'Moose::Meta::Attribute' => [ 'interpolate_class', 'throw_error' ],
19     'Moose::Meta::Class'     => [
20         qw( check_metaclass_compatibility
21             construct_instance
22             create_error
23             create_immutable_transformer
24             raise_error
25             )
26     ],
27     'Moose::Meta::Method' => ['throw_error'],
28     'Moose::Meta::Method::Constructor' =>
29         [qw( initialize_body intialize_body)],
30     'Moose::Meta::Method::Destructor' => ['initialize_body'],
31     'Moose::Role'                     => [
32         qw( after
33             around
34             augment
35             before
36             extends
37             has
38             inner
39             make_immutable
40             override
41             super
42             with )
43     ],
44 );
45
46 for my $module ( sort @modules ) {
47     my $trustme = [];
48     if ( $trustme{$module} ) {
49         my $methods = join '|', @{ $trustme{$module} };
50         $trustme = [qr/^(?:$methods)$/];
51     }
52
53     pod_coverage_ok(
54         $module, { trustme => $trustme },
55         "Pod coverage for $module"
56     );
57 }