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