Don't expect docs for all the Native::* accessor modules
[gitmo/Moose.git] / xt / author / 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.
b5331fcb 14my @modules = grep { !/Accessor::Native.+$/ } all_modules();
e2dab7af 15plan tests => scalar @modules;
16
17my %trustme = (
ccd4cff9 18 'Moose::Meta::Attribute' => [
19 qw( interpolate_class
20 throw_error
21 attach_to_class
22 )
23 ],
97fc9830 24 'Moose::Meta::Attribute::Native::MethodProvider::Array' => ['.+'],
25 'Moose::Meta::Attribute::Native::MethodProvider::Bool' => ['.+'],
5585bc21 26 'Moose::Meta::Attribute::Native::MethodProvider::Code' => ['.+'],
97fc9830 27 'Moose::Meta::Attribute::Native::MethodProvider::Counter' => ['.+'],
28 'Moose::Meta::Attribute::Native::MethodProvider::Hash' => ['.+'],
29 'Moose::Meta::Attribute::Native::MethodProvider::String' => ['.+'],
b0ae51fa 30 'Moose::Meta::Class' => [
70bb0f97 31 qw( check_metaclass_compatibility
32 construct_instance
33 create_error
70bb0f97 34 raise_error
f785aad8 35 reinitialize
fcce13ba 36 superclasses
70bb0f97 37 )
38 ],
53cc86f8 39 'Moose::Meta::Class::Immutable::Trait' => ['.+'],
40 'Moose::Meta::Method' => ['throw_error'],
41 'Moose::Meta::Method::Accessor' => [
73f769fc 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 ],
cefc9e36 52 'Moose::Meta::Method::Constructor' => [
53 qw( attributes
cefc9e36 54 initialize_body
55 meta_instance
56 new
57 options
58 )
59 ],
bcb81995 60 'Moose::Meta::Method::Destructor' => [ 'initialize_body', 'options' ],
705d4cfd 61 'Moose::Meta::Role' => [
62 qw( alias_method
63 get_method_modifier_list
f785aad8 64 reinitialize
705d4cfd 65 reset_package_cache_flag
66 update_package_cache_flag
67 wrap_method_body
68 )
69 ],
f785aad8 70 'Moose::Meta::Mixin::AttributeCore' => ['.+'],
b0ae51fa 71 'Moose::Meta::Role::Composite' =>
72 [ 'get_method', 'get_method_list', 'has_method', 'add_method' ],
73 'Moose::Role' => [
70bb0f97 74 qw( after
75 around
76 augment
77 before
78 extends
79 has
80 inner
70bb0f97 81 override
82 super
83 with )
e2dab7af 84 ],
53cc86f8 85 'Moose::Meta::TypeCoercion' => ['compile_type_coercion'],
2870fb09 86 'Moose::Meta::TypeCoercion::Union' => ['compile_type_coercion'],
53cc86f8 87 'Moose::Meta::TypeConstraint' => ['compile_type_constraint'],
2870fb09 88 'Moose::Meta::TypeConstraint::Class' =>
89 [qw( equals is_a_type_of is_a_subtype_of )],
53cc86f8 90 'Moose::Meta::TypeConstraint::Enum' => [qw( constraint equals )],
b0ae51fa 91 'Moose::Meta::TypeConstraint::DuckType' =>
92 [qw( constraint equals get_message )],
2c3bf4e7 93 'Moose::Meta::TypeConstraint::Parameterizable' => ['.+'],
94 'Moose::Meta::TypeConstraint::Parameterized' => ['.+'],
70f676ca 95 'Moose::Meta::TypeConstraint::Role' => [qw( equals is_a_type_of )],
96 'Moose::Meta::TypeConstraint::Union' =>
97 [qw( compile_type_constraint coercion has_coercion)],
98 'Moose::Util' => ['add_method_modifier'],
99 'Moose::Util::MetaRole' => ['apply_metaclass_roles'],
53cc86f8 100 'Moose::Util::TypeConstraints' => ['find_or_create_type_constraint'],
e2dab7af 101);
102
103for my $module ( sort @modules ) {
b5331fcb 104
e2dab7af 105 my $trustme = [];
106 if ( $trustme{$module} ) {
107 my $methods = join '|', @{ $trustme{$module} };
f37b8c3c 108 $trustme = [qr/^(?:$methods)$/];
e2dab7af 109 }
110
111 pod_coverage_ok(
112 $module, { trustme => $trustme },
113 "Pod coverage for $module"
114 );
115}