On Sun, Jul 5, 2009 at 9:40 PM, Buddy Burden<barefootco...@gmail.com> wrote: > Let's say I have some common functions that I want available to all my > .t files. So I've created a module that all the .t files can include. > But where do I put it? I don't want to put it in lib/ because I > don't want it to get installed, right? But when I put it in t/, make > test can't seem to find it.
I tend to see three variations. (1) put it in t/lib/MyTest.pm and "use lib 't/lib'" at the start of your test files (2) put it in t/MyTest.pm and "use lib 't'" at the start of your test files (3) either of the above but "use t::MyTest" rather than changing @INC with "use lib..." I don't think any one is much better than the others. I tend to like the "t::MyTest" approach from a readability standpoint because it's clear within the *.t file that this is a test library and it's clear where to locate it. -- David