whoops
[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' => ['.+'],
25 'Moose::Meta::Attribute::Native::MethodProvider::Counter' => ['.+'],
26 'Moose::Meta::Attribute::Native::MethodProvider::Hash' => ['.+'],
27 'Moose::Meta::Attribute::Native::MethodProvider::String' => ['.+'],
70bb0f97 28 'Moose::Meta::Class' => [
29 qw( check_metaclass_compatibility
30 construct_instance
31 create_error
70bb0f97 32 raise_error
fcce13ba 33 superclasses
70bb0f97 34 )
35 ],
53cc86f8 36 'Moose::Meta::Class::Immutable::Trait' => ['.+'],
37 'Moose::Meta::Method' => ['throw_error'],
38 'Moose::Meta::Method::Accessor' => [
73f769fc 39 qw( generate_accessor_method
40 generate_accessor_method_inline
41 generate_clearer_method
42 generate_predicate_method
43 generate_reader_method
44 generate_reader_method_inline
45 generate_writer_method
46 generate_writer_method_inline
47 )
48 ],
cefc9e36 49 'Moose::Meta::Method::Constructor' => [
50 qw( attributes
cefc9e36 51 initialize_body
52 meta_instance
53 new
54 options
55 )
56 ],
bcb81995 57 'Moose::Meta::Method::Destructor' => [ 'initialize_body', 'options' ],
705d4cfd 58 'Moose::Meta::Role' => [
59 qw( alias_method
60 get_method_modifier_list
61 reset_package_cache_flag
62 update_package_cache_flag
63 wrap_method_body
64 )
65 ],
da5cc486 66 'Moose::Meta::Role::Composite' => ['add_method'],
67 'Moose::Role' => [
70bb0f97 68 qw( after
69 around
70 augment
71 before
72 extends
73 has
74 inner
70bb0f97 75 override
76 super
77 with )
e2dab7af 78 ],
53cc86f8 79 'Moose::Meta::TypeCoercion' => ['compile_type_coercion'],
2870fb09 80 'Moose::Meta::TypeCoercion::Union' => ['compile_type_coercion'],
53cc86f8 81 'Moose::Meta::TypeConstraint' => ['compile_type_constraint'],
2870fb09 82 'Moose::Meta::TypeConstraint::Class' =>
83 [qw( equals is_a_type_of is_a_subtype_of )],
53cc86f8 84 'Moose::Meta::TypeConstraint::Enum' => [qw( constraint equals )],
1c4f58b2 85 'Moose::Meta::TypeConstraint::DuckType' => [qw( constraint equals get_message )],
2c3bf4e7 86 'Moose::Meta::TypeConstraint::Parameterizable' => ['.+'],
87 'Moose::Meta::TypeConstraint::Parameterized' => ['.+'],
53cc86f8 88 'Moose::Meta::TypeConstraint::Role' => [qw( equals is_a_type_of )],
2870fb09 89 'Moose::Meta::TypeConstraint::Union' => ['compile_type_constraint'],
2c3bf4e7 90 'Moose::Util' => ['add_method_modifier'],
53cc86f8 91 'Moose::Util::TypeConstraints' => ['find_or_create_type_constraint'],
e2dab7af 92);
93
94for my $module ( sort @modules ) {
95 my $trustme = [];
96 if ( $trustme{$module} ) {
97 my $methods = join '|', @{ $trustme{$module} };
f37b8c3c 98 $trustme = [qr/^(?:$methods)$/];
e2dab7af 99 }
100
101 pod_coverage_ok(
102 $module, { trustme => $trustme },
103 "Pod coverage for $module"
104 );
105}