Thursday September 05, 2002
07:23 AM
Test::Pod
well, in following
brian's example, I've created a portable
t/99pod.t that seems to work.
use Test::More;
use File::Spec;
use strict;
eval {
require Test::Pod;
Test::Pod->import;
require File::Find::Rule;
};
my @files;
my $blib = File::Spec->catfile(qw(blib lib));
if ($@) {
plan skip_all => "Test::Pod and File::Find::Rule required for testing POD";
}
else {
@files = File::Find::Rule->file()->name('*.pm')->in($blib);
plan tests => scalar @files;
}
foreach my $file (@files) {
pod_ok($file);
}
that'll make a nice addition to my (growing) collection of standard tests. I really don't know how I ever got along without writing tests - they make development
so much easier. it helps to have stuff like
Test::More and
Apache::Test around. major kudos to all who contribute and make it all possible.
Hooray for teamwork (Score:2)
At this point, maybe brian should just create a Test::Pod::Distro based on this module to encapsulate all this code, so we module authors are not cut'n'pasting it everywhere.
And don't you want to have the File::Spec::catfile call inside the if? Or can that throw an exception that you're wanting to catch?
--
xoa
Re:Hooray for teamwork (Score:1)
teamwork++
Re:Hooray for teamwork (Score:2)
--
xoa
Re:Hooray for teamwork (Score:2)
--
xoa
pod_ok - pod_file_ok (Score:1)
Re:pod_ok - pod_file_ok (Score:2)
--
xoa
Re:pod_ok - pod_file_ok (Score:1)
pod_okreally necessary? personally, distribution pod tests are not important enough for me to require that end-users have the most recent version ofTest::Pod(the test is for me, not for them), so I'd like to make the test as flexible as possible. throwing99pod.........ok 1/1# NOTE: pod_ok() is deprecatedfor users that have old versions of
Test::Podmakes we module releasers look bad, and the only way around them is to eitherPREREQ_PMthe newer modRe:pod_ok - pod_file_ok (Score:2)
--
xoa
Re:Hooray for teamwork (Score:1)
> At this point, maybe brian should just create a Test::Pod::Distro based on this module to
> encapsulate all this code, so we module authors are not cut'n'pasting it everywhere.
That's what Test::Distribution is for. I'm just making it more modular, adding options for checking PREREQ_PM, MANIFEST, exports and more. And I've taken some of code in these comments to make T::D more portable.