make MMC->create and MMR->create install meta methods properly
[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.
77172626 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' ],
699a2e32 61 'Moose::Meta::Method::Meta' => [ 'wrap' ],
705d4cfd 62 'Moose::Meta::Role' => [
63 qw( alias_method
64 get_method_modifier_list
f785aad8 65 reinitialize
705d4cfd 66 reset_package_cache_flag
67 update_package_cache_flag
68 wrap_method_body
69 )
70 ],
f785aad8 71 'Moose::Meta::Mixin::AttributeCore' => ['.+'],
b0ae51fa 72 'Moose::Meta::Role::Composite' =>
73 [ 'get_method', 'get_method_list', 'has_method', 'add_method' ],
74 'Moose::Role' => [
70bb0f97 75 qw( after
76 around
77 augment
78 before
79 extends
80 has
81 inner
70bb0f97 82 override
83 super
84 with )
e2dab7af 85 ],
53cc86f8 86 'Moose::Meta::TypeCoercion' => ['compile_type_coercion'],
2870fb09 87 'Moose::Meta::TypeCoercion::Union' => ['compile_type_coercion'],
53cc86f8 88 'Moose::Meta::TypeConstraint' => ['compile_type_constraint'],
2870fb09 89 'Moose::Meta::TypeConstraint::Class' =>
90 [qw( equals is_a_type_of is_a_subtype_of )],
53cc86f8 91 'Moose::Meta::TypeConstraint::Enum' => [qw( constraint equals )],
b0ae51fa 92 'Moose::Meta::TypeConstraint::DuckType' =>
93 [qw( constraint equals get_message )],
2c3bf4e7 94 'Moose::Meta::TypeConstraint::Parameterizable' => ['.+'],
95 'Moose::Meta::TypeConstraint::Parameterized' => ['.+'],
70f676ca 96 'Moose::Meta::TypeConstraint::Role' => [qw( equals is_a_type_of )],
97 'Moose::Meta::TypeConstraint::Union' =>
98 [qw( compile_type_constraint coercion has_coercion)],
99 'Moose::Util' => ['add_method_modifier'],
100 'Moose::Util::MetaRole' => ['apply_metaclass_roles'],
53cc86f8 101 'Moose::Util::TypeConstraints' => ['find_or_create_type_constraint'],
e2dab7af 102);
103
104for my $module ( sort @modules ) {
b5331fcb 105
e2dab7af 106 my $trustme = [];
107 if ( $trustme{$module} ) {
108 my $methods = join '|', @{ $trustme{$module} };
f37b8c3c 109 $trustme = [qr/^(?:$methods)$/];
e2dab7af 110 }
111
112 pod_coverage_ok(
113 $module, { trustme => $trustme },
114 "Pod coverage for $module"
115 );
116}