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