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