Hi,

I have recently been taking more notice of CPANTS and made some changes to DBD::ODBC to get more "kwalitee". I'm basically getting a fail on has_test_pod (http://cpants.perl.org/dist/kwalitee/DBD-ODBC) which I've duplicated myself with Module::CPANTS::Analyse. However, I have a pod test (although it might look a strange one):

use Test::More;
my $has_test_nowarnings = 1;
eval "require Test::NoWarnings";
$has_test_nowarnings = undef if $@;

END {
    Test::NoWarnings::had_no_warnings()
          if ($has_test_nowarnings);
}

# I need to include Test::NoWarnings to pass cpants but that adds a test
# so that prevents you using all_pod_files_ok as that sets the
# Test::More plan.

my $tests = 3;
$tests += 1 if $has_test_nowarnings;
eval "use Test::Pod 1.00 tests => $tests";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
my @pods = all_pod_files();
foreach my $pod (@pods) {
    next if $pod !~ /(ODBC.pm)|(FAQ.pm)|(Changes.pm)/;
    pod_file_ok($pod);
}

I did not want to insist on anyone having Test::Pod.

I was previously not using Test::NoWarnings (also changed for kwalitee) but I did not like to insist on anyone having Test::NoWarnings because it is not a core module and is only required for the test. However, all_pod_files_ok sets the number of tests itself so I had to split the tests up as above in case someone did not have Test::NoWarnings. Analyse.pm does not seem to spot my use of Test::Pod.

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com

Reply via email to