Merged topic/metarole-distinguishes-role-meta (which includes topic/roles-have-real...
[gitmo/Moose.git] / xt / author / pod_coverage.t
CommitLineData
fcd84ca9 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More;
7
8eval "use Test::Pod::Coverage 1.04";
9plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@;
10
e2dab7af 11# This is a stripped down version of all_pod_coverage_ok which lets us
12# vary the trustme parameter per module.
13my @modules = all_modules();
14plan tests => scalar @modules;
15
16my %trustme = (
ccd4cff9 17 'Moose::Meta::Attribute' => [
18 qw( interpolate_class
19 throw_error
20 attach_to_class
21 )
22 ],
97fc9830 23 'Moose::Meta::Attribute::Native::MethodProvider::Array' => ['.+'],
24 'Moose::Meta::Attribute::Native::MethodProvider::Bool' => ['.+'],
5585bc21 25 'Moose::Meta::Attribute::Native::MethodProvider::Code' => ['.+'],
97fc9830 26 'Moose::Meta::Attribute::Native::MethodProvider::Counter' => ['.+'],
27 'Moose::Meta::Attribute::Native::MethodProvider::Hash' => ['.+'],
28 'Moose::Meta::Attribute::Native::MethodProvider::String' => ['.+'],
b0ae51fa 29 'Moose::Meta::Class' => [
70bb0f97 30 qw( check_metaclass_compatibility
31 construct_instance
32 create_error
70bb0f97 33 raise_error
f785aad8 34 reinitialize
fcce13ba 35 superclasses
70bb0f97 36 )
37 ],
53cc86f8 38 'Moose::Meta::Class::Immutable::Trait' => ['.+'],
39 'Moose::Meta::Method' => ['throw_error'],
40 'Moose::Meta::Method::Accessor' => [
73f769fc 41 qw( generate_accessor_method
42 generate_accessor_method_inline
43 generate_clearer_method
44 generate_predicate_method
45 generate_reader_method
46 generate_reader_method_inline
47 generate_writer_method
48 generate_writer_method_inline
49 )
50 ],
cefc9e36 51 'Moose::Meta::Method::Constructor' => [
52 qw( attributes
cefc9e36 53 initialize_body
54 meta_instance
55 new
56 options
57 )
58 ],
bcb81995 59 'Moose::Meta::Method::Destructor' => [ 'initialize_body', 'options' ],
705d4cfd 60 'Moose::Meta::Role' => [
61 qw( alias_method
62 get_method_modifier_list
f785aad8 63 reinitialize
705d4cfd 64 reset_package_cache_flag
65 update_package_cache_flag
66 wrap_method_body
67 )
68 ],
f785aad8 69 'Moose::Meta::Mixin::AttributeCore' => ['.+'],
b0ae51fa 70 'Moose::Meta::Role::Composite' =>
71 [ 'get_method', 'get_method_list', 'has_method', 'add_method' ],
72 'Moose::Role' => [
70bb0f97 73 qw( after
74 around
75 augment
76 before
77 extends
78 has
79 inner
70bb0f97 80 override
81 super
82 with )
e2dab7af 83 ],
53cc86f8 84 'Moose::Meta::TypeCoercion' => ['compile_type_coercion'],
2870fb09 85 'Moose::Meta::TypeCoercion::Union' => ['compile_type_coercion'],
53cc86f8 86 'Moose::Meta::TypeConstraint' => ['compile_type_constraint'],
2870fb09 87 'Moose::Meta::TypeConstraint::Class' =>
88 [qw( equals is_a_type_of is_a_subtype_of )],
53cc86f8 89 'Moose::Meta::TypeConstraint::Enum' => [qw( constraint equals )],
b0ae51fa 90 'Moose::Meta::TypeConstraint::DuckType' =>
91 [qw( constraint equals get_message )],
2c3bf4e7 92 'Moose::Meta::TypeConstraint::Parameterizable' => ['.+'],
93 'Moose::Meta::TypeConstraint::Parameterized' => ['.+'],
53cc86f8 94 'Moose::Meta::TypeConstraint::Role' => [qw( equals is_a_type_of )],
2870fb09 95 'Moose::Meta::TypeConstraint::Union' => ['compile_type_constraint'],
2c3bf4e7 96 'Moose::Util' => ['add_method_modifier'],
f785aad8 97 'Moose::Util::MetaRole' => ['apply_metaclass_roles'],
53cc86f8 98 'Moose::Util::TypeConstraints' => ['find_or_create_type_constraint'],
e2dab7af 99);
100
101for my $module ( sort @modules ) {
102 my $trustme = [];
103 if ( $trustme{$module} ) {
104 my $methods = join '|', @{ $trustme{$module} };
f37b8c3c 105 $trustme = [qr/^(?:$methods)$/];
e2dab7af 106 }
107
108 pod_coverage_ok(
109 $module, { trustme => $trustme },
110 "Pod coverage for $module"
111 );
112}