Re: Discussion/request on Test::More , have it add t/lib to @INC if -d

2014-01-31 Thread Ricardo Signes
* Eirik Berg Hanssen [2014-01-31T10:17:53] > Yeah; just name the package accordingly, and, screwy or not, it'll still > work: > > package t::lib::MyPackage; > sub import { print "import() was called\n" } This is my advice as well as my custom. -- rjbs signature.asc Description: Digital si

Re: Discussion/request on Test::More , have it add t/lib to @INC if -d

2014-01-31 Thread James E Keenan
On 1/30/14 10:25 PM, Leon Timmermans wrote: On Fri, Jan 31, 2014 at 1:59 AM, Torbjørn Lindahl< torbjorn.lind...@gmail.com> wrote: It seems t/lib is a common place to put modules used to support testing, how about having Test::More push that path to @INC if -d 't/lib' ? It would save me one ,

Re: Discussion/request on Test::More , have it add t/lib to @INC if -d

2014-01-31 Thread Eirik Berg Hanssen
On Fri, Jan 31, 2014 at 2:50 PM, David Cantrell wrote: > That has a few caveats though. > > Your %INC will be a bit screwy, which may matter to some code. And it > will fail to run MyPackage->import(), because t::lib::MyPackage::import > doesn't exist. > > $ cat t/lib/MyPackage.pm > package My

Re: Discussion/request on Test::More , have it add t/lib to @INC if -d

2014-01-31 Thread David Cantrell
On Thu, Jan 30, 2014 at 10:36:19PM -0500, D Perrett wrote: > > use t::lib::MyPackage; > Nice tip! That has a few caveats though. Your %INC will be a bit screwy, which may matter to some code. And it will fail to run MyPackage->import(), because t::lib::MyPackage::import doesn't exist. $ cat t/

Re: Discussion/request on Test::More , have it add t/lib to @INC if -d

2014-01-31 Thread Torbjørn Lindahl
I agree, t::lib::Foo is really the obious solution to my first question. For the other part, I like that evil magic thing, I'll probably publish a separate module that requires and imports all pm files it finds under t/lib or someother assigned dir. It'll still be only one code line in my .t , onl