Add a bunch more words to the spelling whitelist
[gitmo/Moose.git] / xt / release / pod-coverage.t
CommitLineData
fcd84ca9 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More;
7
4d438a84 8use Test::Requires {
b5331fcb 9 'Test::Pod::Coverage' => '1.04', # skip all if not installed
4d438a84 10};
fcd84ca9 11
e2dab7af 12# This is a stripped down version of all_pod_coverage_ok which lets us
13# vary the trustme parameter per module.
77172626 14my @modules = grep { !/Accessor::Native.*$/ } all_modules();
e2dab7af 15plan tests => scalar @modules;
16
17my %trustme = (
ef64ae42 18 'Class::MOP' => [
19 'DEBUG_NO_META',
20 'HAVE_ISAREV',
21 'subname',
22 'in_global_destruction',
23 ],
24 'Class::MOP::Attribute' => ['process_accessors'],
25 'Class::MOP::Class' => [
26 # deprecated
27 'alias_method',
28 'compute_all_applicable_attributes',
29 'compute_all_applicable_methods',
30
31 # unfinished feature
32 'add_dependent_meta_instance',
33 'add_meta_instance_dependencies',
34 'invalidate_meta_instance',
35 'invalidate_meta_instances',
36 'remove_dependent_meta_instance',
37 'remove_meta_instance_dependencies',
38 'update_meta_instance_dependencies',
39
40 # effectively internal
41 'check_metaclass_compatibility',
42 'clone_instance',
43 'construct_class_instance',
44 'construct_instance',
45 'create_meta_instance',
46 'reset_package_cache_flag',
47 'update_package_cache_flag',
48 'reinitialize',
49
50 # doc'd with rebless_instance
51 'rebless_instance_away',
52
53 # deprecated
54 'get_attribute_map',
55 ],
56 'Class::MOP::Class::Immutable::Trait' => ['.+'],
57 'Class::MOP::Class::Immutable::Class::MOP::Class' => ['.+'],
58 'Class::MOP::Deprecated' => ['.+'],
59 'Class::MOP::Instance' => [
60 qw( BUILDARGS
61 bless_instance_structure
62 is_dependent_on_superclasses ),
63 ],
64 'Class::MOP::Instance' => [
65 qw( BUILDARGS
66 bless_instance_structure
67 is_dependent_on_superclasses ),
68 ],
69 'Class::MOP::Method::Accessor' => [
70 qw( generate_accessor_method
71 generate_accessor_method_inline
72 generate_clearer_method
73 generate_clearer_method_inline
74 generate_predicate_method
75 generate_predicate_method_inline
76 generate_reader_method
77 generate_reader_method_inline
78 generate_writer_method
79 generate_writer_method_inline
80 initialize_body
81 )
82 ],
83 'Class::MOP::Method::Constructor' => [
84 qw( attributes
85 generate_constructor_method
86 generate_constructor_method_inline
87 initialize_body
88 meta_instance
89 options
90 )
91 ],
92 'Class::MOP::Method::Generated' => [
93 qw( new
94 definition_context
95 is_inline
96 initialize_body
97 )
98 ],
99 'Class::MOP::MiniTrait' => ['.+'],
100 'Class::MOP::Mixin::AttributeCore' => ['.+'],
101 'Class::MOP::Mixin::HasAttributes' => ['.+'],
102 'Class::MOP::Mixin::HasMethods' => ['.+'],
103 'Class::MOP::Module' => ['create'],
104 'Class::MOP::Package' => [ 'get_method_map', 'wrap_method_body' ],
a5a6b988 105 'Moose::Error::Confess' => ['new'],
ccd4cff9 106 'Moose::Meta::Attribute' => [
107 qw( interpolate_class
108 throw_error
109 attach_to_class
110 )
111 ],
97fc9830 112 'Moose::Meta::Attribute::Native::MethodProvider::Array' => ['.+'],
113 'Moose::Meta::Attribute::Native::MethodProvider::Bool' => ['.+'],
5585bc21 114 'Moose::Meta::Attribute::Native::MethodProvider::Code' => ['.+'],
97fc9830 115 'Moose::Meta::Attribute::Native::MethodProvider::Counter' => ['.+'],
116 'Moose::Meta::Attribute::Native::MethodProvider::Hash' => ['.+'],
117 'Moose::Meta::Attribute::Native::MethodProvider::String' => ['.+'],
b0ae51fa 118 'Moose::Meta::Class' => [
70bb0f97 119 qw( check_metaclass_compatibility
120 construct_instance
121 create_error
70bb0f97 122 raise_error
f785aad8 123 reinitialize
fcce13ba 124 superclasses
70bb0f97 125 )
126 ],
53cc86f8 127 'Moose::Meta::Class::Immutable::Trait' => ['.+'],
128 'Moose::Meta::Method' => ['throw_error'],
129 'Moose::Meta::Method::Accessor' => [
73f769fc 130 qw( generate_accessor_method
131 generate_accessor_method_inline
132 generate_clearer_method
133 generate_predicate_method
134 generate_reader_method
135 generate_reader_method_inline
136 generate_writer_method
137 generate_writer_method_inline
138 )
139 ],
cefc9e36 140 'Moose::Meta::Method::Constructor' => [
141 qw( attributes
cefc9e36 142 initialize_body
143 meta_instance
144 new
145 options
146 )
147 ],
bcb81995 148 'Moose::Meta::Method::Destructor' => [ 'initialize_body', 'options' ],
a5a6b988 149 'Moose::Meta::Method::Meta' => ['wrap'],
705d4cfd 150 'Moose::Meta::Role' => [
151 qw( alias_method
152 get_method_modifier_list
f785aad8 153 reinitialize
705d4cfd 154 reset_package_cache_flag
155 update_package_cache_flag
156 wrap_method_body
157 )
158 ],
f785aad8 159 'Moose::Meta::Mixin::AttributeCore' => ['.+'],
b0ae51fa 160 'Moose::Meta::Role::Composite' =>
161 [ 'get_method', 'get_method_list', 'has_method', 'add_method' ],
162 'Moose::Role' => [
70bb0f97 163 qw( after
164 around
165 augment
166 before
167 extends
168 has
169 inner
70bb0f97 170 override
171 super
172 with )
e2dab7af 173 ],
53cc86f8 174 'Moose::Meta::TypeCoercion' => ['compile_type_coercion'],
2870fb09 175 'Moose::Meta::TypeCoercion::Union' => ['compile_type_coercion'],
53cc86f8 176 'Moose::Meta::TypeConstraint' => ['compile_type_constraint'],
2870fb09 177 'Moose::Meta::TypeConstraint::Class' =>
178 [qw( equals is_a_type_of is_a_subtype_of )],
53cc86f8 179 'Moose::Meta::TypeConstraint::Enum' => [qw( constraint equals )],
b0ae51fa 180 'Moose::Meta::TypeConstraint::DuckType' =>
181 [qw( constraint equals get_message )],
2c3bf4e7 182 'Moose::Meta::TypeConstraint::Parameterizable' => ['.+'],
183 'Moose::Meta::TypeConstraint::Parameterized' => ['.+'],
70f676ca 184 'Moose::Meta::TypeConstraint::Role' => [qw( equals is_a_type_of )],
185 'Moose::Meta::TypeConstraint::Union' =>
186 [qw( compile_type_constraint coercion has_coercion)],
187 'Moose::Util' => ['add_method_modifier'],
188 'Moose::Util::MetaRole' => ['apply_metaclass_roles'],
53cc86f8 189 'Moose::Util::TypeConstraints' => ['find_or_create_type_constraint'],
e2dab7af 190);
191
192for my $module ( sort @modules ) {
b5331fcb 193
e2dab7af 194 my $trustme = [];
195 if ( $trustme{$module} ) {
196 my $methods = join '|', @{ $trustme{$module} };
f37b8c3c 197 $trustme = [qr/^(?:$methods)$/];
e2dab7af 198 }
199
200 pod_coverage_ok(
201 $module, { trustme => $trustme },
202 "Pod coverage for $module"
203 );
204}