3 ##############################################################################
8 ##############################################################################
14 eval 'use Test::Pod::Coverage 1.04'; ## no critic
15 plan skip_all => 'Test::Pod::Coverage 1.00 requried to test POD' if $@;
18 # HACK: Perl::Critic::Violation uses Pod::Parser to extract the
19 # DIAGNOSTIC section of the POD in each Policy module. This
20 # happens when the Policy first C<uses> the Violation module.
21 # Meanwhile, Pod::Coverage also uses Pod::Parser to extract the
22 # POD and compare it with the subroutines that are in the symbol
23 # table for that module. For reasons I cannot yet explain, using
24 # Pod::Parser twice this way causes the symbol table to get very
25 # wacky and this test script dies with "Can't call method 'OPEN'
26 # on IO::String at line 1239 of Pod/Parser.pm".
28 # For now, my workaround is to temporarily redefine the import()
29 # method in the Violation module so that it doesn't do any Pod
30 # parsing. I'll look for a better solution (or file a bug report)
31 # when / if I have better understanding of the problem.
34 require Perl::Critic::Violation;
35 *Perl::Critic::Violation::import = sub { 1 };
38 my @trusted_methods = get_trusted_methods();
39 my $method_string = join ' | ', @trusted_methods;
40 my $trusted_rx = qr{ \A (?: $method_string ) \z }x;
41 all_pod_coverage_ok( {trustme => [$trusted_rx]} );
43 #-----------------------------------------------------------------------------
45 sub get_trusted_methods {
58 ##############################################################################
61 # cperl-indent-level: 4
63 # indent-tabs-mode: nil
64 # c-indentation-style: bsd
66 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab :