3 ##############################################################################
4 # $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/99_pod_coverage.t $
5 # $Date: 2008-06-06 00:48:04 -0500 (Fri, 06 Jun 2008) $
8 ##############################################################################
15 eval 'use Test::Pod::Coverage 1.04'; ## no critic
16 plan skip_all => 'Test::Pod::Coverage 1.00 requried to test POD' if $@;
19 # HACK: Perl::Critic::Violation uses Pod::Parser to extract the
20 # DIAGNOSTIC section of the POD in each Policy module. This
21 # happens when the Policy first C<uses> the Violation module.
22 # Meanwhile, Pod::Coverage also uses Pod::Parser to extract the
23 # POD and compare it with the subroutines that are in the symbol
24 # table for that module. For reasons I cannot yet explain, using
25 # Pod::Parser twice this way causes the symbol table to get very
26 # wacky and this test script dies with "Can't call method 'OPEN'
27 # on IO::String at line 1239 of Pod/Parser.pm".
29 # For now, my workaround is to temporarily redefine the import()
30 # method in the Violation module so that it doesn't do any Pod
31 # parsing. I'll look for a better solution (or file a bug report)
32 # when / if I have better understanding of the problem.
35 require Perl::Critic::Violation;
36 *Perl::Critic::Violation::import = sub { 1 };
39 my @trusted_methods = get_trusted_methods();
40 my $method_string = join ' | ', @trusted_methods;
41 my $trusted_rx = qr{ \A (?: $method_string ) \z }x;
42 all_pod_coverage_ok( {trustme => [$trusted_rx]} );
44 #-----------------------------------------------------------------------------
46 sub get_trusted_methods {
53 default_maximum_violations_per_document
62 ##############################################################################
65 # cperl-indent-level: 4
67 # indent-tabs-mode: nil
68 # c-indentation-style: bsd
70 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :