Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Pod CPAN distribution.

Report information
The Basics
Id: 16356
Status: resolved
Priority: 0/
Queue: Test-Pod

People
Owner: Nobody in particular
Requestors: LGODDARD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



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; }
[LGODDARD - Thu Dec 8 09:23:03 2005]: Show quoted text
> ... Haven't looked much further, I presume the > instance attributes are propogated to class globals somewhere.
Yeah, I didn't look very far until I copied the patch into my .t file: $Test is global. That's DISGUSTING!!! Show quoted text
> > 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; > }