X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fpod-coverage.t;h=3b65054935bce01882d889d0afbbe97424e81d74;hb=a65278184fdc1c633ea0feb8aede99964bd00642;hp=4005e5e587e91d6079813df02aecf2c362b0d9dc;hpb=8d65540448deca131e4c77686c6a1135116e522e;p=gitmo%2FMooseX-ClassAttribute.git diff --git a/t/pod-coverage.t b/t/pod-coverage.t index 4005e5e..3b65054 100644 --- a/t/pod-coverage.t +++ b/t/pod-coverage.t @@ -3,7 +3,6 @@ use warnings; use Test::More; - plan skip_all => 'This test is only run for the module author' unless -d '.svn' || $ENV{IS_MAINTAINER}; @@ -11,4 +10,35 @@ eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; -all_pod_coverage_ok( { trustme => [ qr/^(?:class_has|process_class_attribute|container_class|unimport)$/ ] } ); +# 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::Method::Accessor' => qr/.+/, + ); + +for my $module ( sort @modules ) +{ + my $trustme; + + if ( $trustme{$module} ) + { + # why is qr// not a ref? + if ( ! ref $trustme{module} ) + { + $trustme = [ $trustme{module} ] + } + else + { + my $methods = join '|', @{ $trustme{$module} }; + $trustme = [ qr/^(?:$methods)/ ]; + } + } + + pod_coverage_ok( $module, { trustme => $trustme }, + "Pod coverage for $module" + ); +}