Fix pod coverage test to actually exclude things that should be
[gitmo/Moose.git] / xt / pod_coverage.t
CommitLineData
fcd84ca9 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More;
7
8eval "use Test::Pod::Coverage 1.04";
9plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@;
10
e2dab7af 11# This is a stripped down version of all_pod_coverage_ok which lets us
12# vary the trustme parameter per module.
13my @modules = all_modules();
14plan tests => scalar @modules;
15
16my %trustme = (
93a708fd 17 'Moose' => ['make_immutable'],
18 'Moose::Meta::Attribute' => [ 'interpolate_class', 'throw_error' ],
70bb0f97 19 'Moose::Meta::Class' => [
20 qw( check_metaclass_compatibility
21 construct_instance
22 create_error
23 create_immutable_transformer
24 raise_error
25 )
26 ],
73f769fc 27 'Moose::Meta::Method' => ['throw_error'],
28 'Moose::Meta::Method::Accessor' => [
29 qw( generate_accessor_method
30 generate_accessor_method_inline
31 generate_clearer_method
32 generate_predicate_method
33 generate_reader_method
34 generate_reader_method_inline
35 generate_writer_method
36 generate_writer_method_inline
37 )
38 ],
cefc9e36 39 'Moose::Meta::Method::Constructor' => [
40 qw( attributes
41 generate_constructor_method
42 generate_constructor_method_inline
43 initialize_body
44 meta_instance
45 new
46 options
47 )
48 ],
bcb81995 49 'Moose::Meta::Method::Destructor' => [ 'initialize_body', 'options' ],
705d4cfd 50 'Moose::Meta::Role' => [
51 qw( alias_method
52 get_method_modifier_list
53 reset_package_cache_flag
54 update_package_cache_flag
55 wrap_method_body
56 )
57 ],
da5cc486 58 'Moose::Meta::Role::Composite' => ['add_method'],
59 'Moose::Role' => [
70bb0f97 60 qw( after
61 around
62 augment
63 before
64 extends
65 has
66 inner
67 make_immutable
68 override
69 super
70 with )
e2dab7af 71 ],
2870fb09 72 'Moose::Meta::TypeCoercion::Union' => ['compile_type_coercion'],
cfd006f0 73 'Moose::Meta::TypeConstraint' => [ 'compile_type_constraint', 'union' ],
2870fb09 74 'Moose::Meta::TypeConstraint::Class' =>
75 [qw( equals is_a_type_of is_a_subtype_of )],
76 'Moose::Meta::TypeConstraint::Union' => ['compile_type_constraint'],
e2dab7af 77);
78
79for my $module ( sort @modules ) {
80 my $trustme = [];
81 if ( $trustme{$module} ) {
82 my $methods = join '|', @{ $trustme{$module} };
f37b8c3c 83 $trustme = [qr/^(?:$methods)$/];
e2dab7af 84 }
85
86 pod_coverage_ok(
87 $module, { trustme => $trustme },
88 "Pod coverage for $module"
89 );
90}