make MMC->create and MMR->create install meta methods properly
[gitmo/Moose.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 = grep { !/Accessor::Native.*$/ } all_modules();
15 plan tests => scalar @modules;
16
17 my %trustme = (
18     'Moose::Meta::Attribute' => [
19         qw( interpolate_class
20             throw_error
21             attach_to_class
22             )
23     ],
24     'Moose::Meta::Attribute::Native::MethodProvider::Array'   => ['.+'],
25     'Moose::Meta::Attribute::Native::MethodProvider::Bool'    => ['.+'],
26     'Moose::Meta::Attribute::Native::MethodProvider::Code'    => ['.+'],
27     'Moose::Meta::Attribute::Native::MethodProvider::Counter' => ['.+'],
28     'Moose::Meta::Attribute::Native::MethodProvider::Hash'    => ['.+'],
29     'Moose::Meta::Attribute::Native::MethodProvider::String'  => ['.+'],
30     'Moose::Meta::Class'                                      => [
31         qw( check_metaclass_compatibility
32             construct_instance
33             create_error
34             raise_error
35             reinitialize
36             superclasses
37             )
38     ],
39     'Moose::Meta::Class::Immutable::Trait' => ['.+'],
40     'Moose::Meta::Method'                  => ['throw_error'],
41     'Moose::Meta::Method::Accessor'        => [
42         qw( generate_accessor_method
43             generate_accessor_method_inline
44             generate_clearer_method
45             generate_predicate_method
46             generate_reader_method
47             generate_reader_method_inline
48             generate_writer_method
49             generate_writer_method_inline
50             )
51     ],
52     'Moose::Meta::Method::Constructor' => [
53         qw( attributes
54             initialize_body
55             meta_instance
56             new
57             options
58             )
59     ],
60     'Moose::Meta::Method::Destructor' => [ 'initialize_body', 'options' ],
61     'Moose::Meta::Method::Meta'       => [ 'wrap' ],
62     'Moose::Meta::Role'               => [
63         qw( alias_method
64             get_method_modifier_list
65             reinitialize
66             reset_package_cache_flag
67             update_package_cache_flag
68             wrap_method_body
69             )
70     ],
71     'Moose::Meta::Mixin::AttributeCore' => ['.+'],
72     'Moose::Meta::Role::Composite' =>
73         [ 'get_method', 'get_method_list', 'has_method', 'add_method' ],
74     'Moose::Role' => [
75         qw( after
76             around
77             augment
78             before
79             extends
80             has
81             inner
82             override
83             super
84             with )
85     ],
86     'Moose::Meta::TypeCoercion'        => ['compile_type_coercion'],
87     'Moose::Meta::TypeCoercion::Union' => ['compile_type_coercion'],
88     'Moose::Meta::TypeConstraint'      => ['compile_type_constraint'],
89     'Moose::Meta::TypeConstraint::Class' =>
90         [qw( equals is_a_type_of is_a_subtype_of )],
91     'Moose::Meta::TypeConstraint::Enum' => [qw( constraint equals )],
92     'Moose::Meta::TypeConstraint::DuckType' =>
93         [qw( constraint equals get_message )],
94     'Moose::Meta::TypeConstraint::Parameterizable' => ['.+'],
95     'Moose::Meta::TypeConstraint::Parameterized'   => ['.+'],
96     'Moose::Meta::TypeConstraint::Role' => [qw( equals is_a_type_of )],
97     'Moose::Meta::TypeConstraint::Union' =>
98         [qw( compile_type_constraint coercion has_coercion)],
99     'Moose::Util'                  => ['add_method_modifier'],
100     'Moose::Util::MetaRole'        => ['apply_metaclass_roles'],
101     'Moose::Util::TypeConstraints' => ['find_or_create_type_constraint'],
102 );
103
104 for my $module ( sort @modules ) {
105
106     my $trustme = [];
107     if ( $trustme{$module} ) {
108         my $methods = join '|', @{ $trustme{$module} };
109         $trustme = [qr/^(?:$methods)$/];
110     }
111
112     pod_coverage_ok(
113         $module, { trustme => $trustme },
114         "Pod coverage for $module"
115     );
116 }