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
MULTICREATE_DEBUG
/],
},
+ 'DBIx::Class::FilterColumn' => {
+ ignore => [qw/
+ new
+ update
+ store_column
+ get_column
+ get_columns
+ /],
+ },
'DBIx::Class::ResultSource' => {
ignore => [qw/
compare_relationship_keys
/]
},
+ 'DBIx::Class::Admin' => {
+ ignore => [ qw/
+ BUILD
+ /]
+ },
+
'DBIx::Class::Storage::DBI::Replicated*' => {
ignore => [ qw/
connect_call_do_sql
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) )
;
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");
}
}