File: release-pod-coverage.t

package info (click to toggle)
libmoosex-classattribute-perl 0.27-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 244 kB
  • ctags: 47
  • sloc: perl: 994; makefile: 2
file content (47 lines) | stat: -rw-r--r-- 1,243 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

BEGIN {
  unless ($ENV{RELEASE_TESTING}) {
    require Test::More;
    Test::More::plan(skip_all => 'these tests are for release candidate testing');
  }
}

use strict;
use warnings;

use Test::More;

use Test::Requires {
    'Test::Pod::Coverage' => '1.04', # skip all if not installed
};

# This is a stripped down version of all_pod_coverage_ok which lets us
# vary the trustme parameter per module.
my @modules = all_modules();
plan tests => scalar @modules;

my %trustme = (
    'MooseX::ClassAttribute' => [ 'init_meta', 'class_has' ],
    'MooseX::ClassAttribute::Meta::Role::Attribute'  => ['new'],
    'MooseX::ClassAttribute::Trait::Class' =>
        ['compute_all_applicable_class_attributes'],
    'MooseX::ClassAttribute::Trait::Role' =>
        ['composition_class_roles'],
    'MooseX::ClassAttribute::Trait::Mixin::HasClassAttributes' => [
        qw( add_class_attribute get_class_attribute_map remove_class_attribute )
    ],
);

for my $module ( sort @modules ) {
    my $trustme;

    if ( $trustme{$module} ) {
        my $methods = join '|', @{ $trustme{$module} };
        $trustme = [qr/^(?:$methods)/];
    }

    pod_coverage_ok(
        $module, { trustme => $trustme },
        "Pod coverage for $module"
    );
}