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