die on attributes with no methods and no is => 'bare'
[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'],
ae907ae0 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 )],
2c3bf4e7 82 'Moose::Meta::TypeConstraint::Parameterizable' => ['.+'],
83 'Moose::Meta::TypeConstraint::Parameterized' => ['.+'],
53cc86f8 84 'Moose::Meta::TypeConstraint::Role' => [qw( equals is_a_type_of )],
2870fb09 85 'Moose::Meta::TypeConstraint::Union' => ['compile_type_constraint'],
2c3bf4e7 86 'Moose::Util' => ['add_method_modifier'],
53cc86f8 87 'Moose::Util::TypeConstraints' => ['find_or_create_type_constraint'],
e2dab7af 88);
89
90for my $module ( sort @modules ) {
91 my $trustme = [];
92 if ( $trustme{$module} ) {
93 my $methods = join '|', @{ $trustme{$module} };
f37b8c3c 94 $trustme = [qr/^(?:$methods)$/];
e2dab7af 95 }
96
97 pod_coverage_ok(
98 $module, { trustme => $trustme },
99 "Pod coverage for $module"
100 );
101}