Trying to spear a phalanx shield for pod
I'm about to add a POD test program to my phalanx distro.
Before I do that, just want to check I'm using the best model.
I plan on using the one from WWW::Mechanize (shown below) --
unless someone can suggest a better model.
Is it worth trying to agree on a de facto standard name for
such a beast: 99-pod.t/99_pod.t/99.pod.t/99pod.t?
use Test::More;
use File::Spec;
use File::Find;
use strict;
eval {
require Test::Pod;
};
my $ok = !$@ && ($Test::Pod::VERSION >= '0.95');
if (!$ok) {
plan skip_all => "Test::Pod v0.95 required for testing POD";
} else {
Test::Pod->import;
my @files;
my $blib = File::Spec->catfile(qw(blib lib));
find( sub {push @files, $File::Find::name if /\.p(l|m|od)$/}, $blib);
plan tests => scalar @files;
foreach my $file (@files) {
pod_file_ok($file);
}
}
/-\
http://personals.yahoo.com.au - Yahoo! Personals
New people, new possibilities. FREE for a limited time.
Re: Trying to spear a phalanx shield for pod
> Is it worth trying to agree on a de facto standard name for > such a beast: 99-pod.t/99_pod.t/99.pod.t/99pod.t? Personally, I'd just as soon not have it be one of the numeric ones. It doesn't matter what order it's run in. xoa -- Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance
Re: Trying to spear a phalanx shield for pod
On Fri, Oct 24, 2003 at 11:23:52PM +1000, Andrew Savige wrote:
> Is it worth trying to agree on a de facto standard name for
> such a beast: 99-pod.t/99_pod.t/99.pod.t/99pod.t?
Probably not worth the inevitable argument.
> use Test::More;
>
> use File::Spec;
> use File::Find;
> use strict;
>
> eval {
> require Test::Pod;
> };
>
> my $ok = !$@ && ($Test::Pod::VERSION >= '0.95');
>
> if (!$ok) {
> plan skip_all => "Test::Pod v0.95 required for testing POD";
> } else {
> Test::Pod->import;
> my @files;
> my $blib = File::Spec->catfile(qw(blib lib));
> find( sub {push @files, $File::Find::name if /\.p(l|m|od)$/}, $blib);
> plan tests => scalar @files;
> foreach my $file (@files) {
> pod_file_ok($file);
> }
> }
Since skip_all will exit immediately you can fold that big "everything
inside the else block" away.
eval 'use Test::Pod';
my $have_testpod = !$@ and $Test::Pod::VERSION >= 0.95;
plan skip_all => "Test::Pod v0.95 required for testing POD"
unless $have_testpod;
my @files;
my $blib = File::Spec->catfile(qw(blib lib));
...
--
Michael G Schwern[EMAIL PROTECTED] http://www.pobox.com/~schwern/
You're like a moment of mindblowing bliss.
