Skip Menu |

This queue is for tickets about the Module-Pluggable CPAN distribution.

Report information
The Basics
Id: 20861
Status: rejected
Priority: 0/
Queue: Module-Pluggable

People
Owner: simonw [...] cpan.org
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 3.1
Fixed in: (no value)



Subject: blib.pm != testing
clkao pointed out this code in Module::Pluggable::Object. # check to see if we're running under test my @SEARCHDIR = exists $INC{"blib.pm"} && $filename =~ m!(^|/)blib/! ? grep {/blib/} @INC : @INC; I'm not sure what the above is for or why its there but it doesn't really do what the comment says. MakeMaker doesn't use blib.pm. clkao reports the above code causes problems when he uses -Mblib or Devel::Cover. More importantly, testing code shouldn't be in the production code. It should be in the tests. Not coincidentally the best way to determine if you're running under test is to be part of the test suite. :) If that's not possible (and it looks like it might be a bit tricky), just have your tests set their own PERL_MODULE_PLUGGABLE_TESTING env flag and look for that. Assuming the purpose of that code is to determine you're running your own tests, not someone else's.
On Sat Aug 05 18:18:50 2006, MSCHWERN wrote: Show quoted text
> clkao pointed out this code in Module::Pluggable::Object.
Show quoted text
> If that's not possible (and it looks like it might be a bit tricky), > just have your tests set their own PERL_MODULE_PLUGGABLE_TESTING env > flag and look for that. Assuming the purpose of that code is to > determine you're running your own tests, not someone else's.
Actually it's for people who are testing modules that use Module::Pluggable. For example - Email::Store needs to check to see what modules it's shipped with or test the functionality of one of the shipped plugins. Therefore we don't wnat to get confused by plugins in the system wide distribution. I'll have a think about this.