File: pod-coverage.t

package info (click to toggle)
libmaxmind-db-reader-perl 1.000014-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,040 kB
  • sloc: perl: 1,668; makefile: 10
file content (54 lines) | stat: -rw-r--r-- 1,388 bytes parent folder | download | duplicates (2)
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
48
49
50
51
52
53
54
#!perl
# This file was automatically generated by Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable 0.07.

use Test::Pod::Coverage 1.08;
use Test::More 0.88;

BEGIN {
    if ( $] <= 5.008008 ) {
        plan skip_all => 'These tests require Pod::Coverage::TrustPod, which only works with Perl 5.8.9+';
    }
}
use Pod::Coverage::TrustPod;

{
    package
        My::Coverage;
    use parent 'Pod::Coverage::Moose', 'Pod::Coverage::TrustPod';
    $INC{'My/Coverage.pm'} = 1;
}

my %skip = map { $_ => 1 } qw( MaxMind::DB::Reader::Data::Container MaxMind::DB::Reader::Data::EndMarker MaxMind::DB::Reader::Decoder MaxMind::DB::Reader::PP MaxMind::DB::Verifier );

my @modules;
for my $module ( all_modules() ) {
    next if $skip{$module};
    next if $module =~ qr/^MaxMind::DB::Reader::Role/;

    push @modules, $module;
}

plan skip_all => 'All the modules we found were excluded from POD coverage test.'
    unless @modules;

plan tests => scalar @modules;

my %trustme = ();

my @also_private = (
                  qr/\A (?: BUILD(?:ARGS)? | DEMOLISH ) \z/x
                );

for my $module ( sort @modules ) {
    pod_coverage_ok(
        $module,
        {
            coverage_class => 'My::Coverage',
            also_private   => \@also_private,
            trustme        => $trustme{$module} || [],
        },
        "pod coverage for $module"
    );
}

done_testing();