X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fpod-coverage.t;h=105d648d9553fcd4a3c4cef89c0fabccb40f5290;hb=7a4a3b1efe4db788811154fbecbf6c94ceeee4bf;hp=4005e5e587e91d6079813df02aecf2c362b0d9dc;hpb=a5e3ddfd4ab2cbdeea6f3c9769b7a153030e7cc7;p=gitmo%2FMooseX-ClassAttribute.git diff --git a/t/pod-coverage.t b/t/pod-coverage.t index 4005e5e..105d648 100644 --- a/t/pod-coverage.t +++ b/t/pod-coverage.t @@ -3,12 +3,38 @@ use warnings; use Test::More; +eval "use Test::Pod::Coverage 1.04"; +plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; -plan skip_all => 'This test is only run for the module author' - unless -d '.svn' || $ENV{IS_MAINTAINER}; +# 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; -eval "use Test::Pod::Coverage 1.04"; -plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" - if $@; +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)/ ]; + } + } -all_pod_coverage_ok( { trustme => [ qr/^(?:class_has|process_class_attribute|container_class|unimport)$/ ] } ); + pod_coverage_ok( $module, { trustme => $trustme }, + "Pod coverage for $module" + ); +}