dev/testing while using File::ShareDir
joel at fysh.org
Thu Oct 29 11:58:12 GMT 2009
I'm developing a module which uses Module::Install::ShareDir to
install some data files, and File::ShareDir to access them.
When installed, it can find them fine. However when I try to run unit
tests, it will either get data files from an installed version (not
what I want) or fail to find them at all.
I can think of various hackish workarounds, and am wondering whether
anybody has experience of these. One thought is to walk back up the
INC tree from the module location, looking for a Makefile.PL (i.e. if
we're running from a dist checkout, we're in "dev" mode and shouldn't
use ShareDir), another is to wrap ShareDir in something that returns
() if the dir doesn't exist.
Has anybody else already solved this? I couldn't find anything on CPAN
that looked relevant.
More information about the london.pm