X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F03podcoverage.t;h=18df9cfb70d909ded933547cc0f83528db0bb4e9;hb=492bb85a977b5b708fd87af25ebd41a459a9087b;hp=bcda97dd619dd8362b923631a3e6fb4514099ac2;hpb=5f6a861d4cbf4f6865d49013564ecf4a8ca952d8;p=dbsrgits%2FDBIx-Class.git diff --git a/t/03podcoverage.t b/t/03podcoverage.t index bcda97d..18df9cf 100644 --- a/t/03podcoverage.t +++ b/t/03podcoverage.t @@ -2,35 +2,29 @@ use warnings; use strict; use Test::More; -use List::Util (); +use List::Util 'first'; use lib qw(t/lib); use DBICTest; - -my @MODULES = ( - 'Test::Pod::Coverage 1.08', - 'Pod::Coverage 0.20', -); +use namespace::clean; # Don't run tests for installs unless ( DBICTest::AuthorCheck->is_author || $ENV{AUTOMATED_TESTING} || $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } -# Load the testing modules -foreach my $MODULE ( @MODULES ) { - eval "use $MODULE"; - if ( $@ ) { - $ENV{RELEASE_TESTING} - ? die( "Failed to load required release-testing module $MODULE" ) - : plan( skip_all => "$MODULE not available for testing" ); - } +require DBIx::Class; +unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_podcoverage') ) { + my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_podcoverage'); + $ENV{RELEASE_TESTING} || DBICTest::AuthorCheck->is_author + ? die ("Failed to load release-testing module requirements: $missing") + : plan skip_all => "Test needs: $missing" } # Since this is about checking documentation, a little documentation # of what this is doing might be in order. # The exceptions structure below is a hash keyed by the module # name. Any * in a name is treated like a wildcard and will behave -# as expected. Modules are matched by longest string first, so +# as expected. Modules are matched by longest string first, so # A::B::C will match even if there is A::B* # The value for each is a hash, which contains one or more @@ -53,6 +47,15 @@ my $exceptions = { MULTICREATE_DEBUG /], }, + 'DBIx::Class::FilterColumn' => { + ignore => [qw/ + new + update + store_column + get_column + get_columns + /], + }, 'DBIx::Class::ResultSource' => { ignore => [qw/ compare_relationship_keys @@ -86,6 +89,12 @@ my $exceptions = { /] }, + 'DBIx::Class::Admin' => { + ignore => [ qw/ + BUILD + /] + }, + 'DBIx::Class::Storage::DBI::Replicated*' => { ignore => [ qw/ connect_call_do_sql @@ -93,6 +102,7 @@ my $exceptions = { /] }, + 'DBIx::Class::Admin::*' => { skip => 1 }, 'DBIx::Class::ClassResolver::PassThrough' => { skip => 1 }, 'DBIx::Class::Componentised' => { skip => 1 }, 'DBIx::Class::Relationship::*' => { skip => 1 }, @@ -131,8 +141,8 @@ my @modules = sort { $a cmp $b } (Test::Pod::Coverage::all_modules()); foreach my $module (@modules) { SKIP: { - my ($match) = List::Util::first - { $module =~ $_ } + my ($match) = + first { $module =~ $_ } (sort { length $b <=> length $a || $b cmp $a } (keys %$ex_lookup) ) ; @@ -147,7 +157,7 @@ foreach my $module (@modules) { if exists($ex->{ignore}); # run the test with the potentially modified parm set - pod_coverage_ok($module, $parms, "$module POD coverage"); + Test::Pod::Coverage::pod_coverage_ok($module, $parms, "$module POD coverage"); } }