On 2011-04-21 14:43:28, MRDVT wrote:
Show quoted text> use Test::Pod::Coverage tests=>1;
> pod_coverage_ok( "MY::DELETED::PACKAGE", "covered" );
>
> But, it was not looking only in blib and should have failed since this
> package was being deleted from the distribution.
>
> Instead it found the one installed
> in /usr/lib/perl5/vendor_perl/5.10.0/ and mistakenly passed.
>
> Mike
>
> mrdvt92
The root problem here is a little subtle --
1, we convert the filename to a module name early on and throw away the filename,
2, we don't preserve whether we are looking in lib or blib,
3, other coverage classes (notably Pod::Coverage::CountParents, which is inherited by Pod::Coverage::TrustPod - used in a huge number of dists) actually *load* the module without first adding lib or blib to @INC.
The consequences therefore are:
- the caller must use -Ilib, -Mblib, or otherwise ensure that the modules being tested are in @INC (and this should be documented),
- the module should check that the thing it loaded actually came from the filename it thinks it should (to catch the deleted-in-local-repository case).