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