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