Subject: | PATCH to fix Test::Builder 'You tried to plan twice!' error |
The double-indented lines below are necessary to prevent the error 'You tried to plan twice!' which occurs if this module is used with Test::Pod::Coverage. Haven't looked much further, I presume the instance attributes are propogated to class globals somewhere. Anyway, this fixes it...
sub all_pod_files_ok {
my @files = @_ ? @_ : all_pod_files();
delete $Test->{Have_Plan};
delete $Test->{No_Plan};
$Test->plan( tests => scalar @files );
my $ok = 1;
foreach my $file ( @files ) {
pod_file_ok( $file, $file ) or undef $ok;
}
return $ok;
}