Re: use mocked

2007-02-22 Thread Luke Closs
On 2/22/07, Ovid <[EMAIL PROTECTED]> wrote: Telling me "you can only use t/lib for mocked modules" Woah, dude. mocked.pm loads mocked modules from t/lib. You can use t/lib for whatever else you want. So you could keep your existing test modules there, and put the mock test modules there to

Re: use mocked

2007-02-22 Thread chromatic
On Thursday 22 February 2007 23:21, Ovid wrote: > --- Luke Closs <[EMAIL PROTECTED]> wrote: > > Plus, I'm trying to get this t/lib mocking meme going. :) > > Except that I am already using t/lib for a bunch of other helper > modules I use in our testing code. Telling me "you can only use t/lib >

Re: use mocked

2007-02-22 Thread Ovid
--- Luke Closs <[EMAIL PROTECTED]> wrote: > > Would there be an option to specify where to find the mocked libs, > > rather than assuming t/lib? > > > > There certainly could be, but I have no intention of doing this. One > could always send me a patch and subclass mocked: > > use awesome_mock

Re: use mocked

2007-02-22 Thread Fergal Daly
On 22/02/07, chromatic <[EMAIL PROTECTED]> wrote: On Thursday 22 February 2007 12:53, Andy Lester wrote: > Would there be an option to specify where to find the mocked libs, > rather than assuming t/lib? But: use mocked 't/some_other_lib/' SomeModule; ... isn't all that much shorter t

Re: use mocked

2007-02-22 Thread Andy Lester
On Feb 22, 2007, at 2:59 PM, chromatic wrote: On Thursday 22 February 2007 12:53, Andy Lester wrote: Would there be an option to specify where to find the mocked libs, rather than assuming t/lib? But: use mocked 't/some_other_lib/' SomeModule; What I meant was use mocked in => '

Re: use mocked

2007-02-22 Thread Luke Closs
On 2/22/07, Andy Lester <[EMAIL PROTECTED]> wrote: On Feb 22, 2007, at 2:49 PM, Luke Closs wrote: > So I just hacked up mocked.pm, which will only load libraries from > t/lib. > The above example would look like: > > use mocked 'LWP::Simple'; Would there be an option to specify where to find

Re: use mocked

2007-02-22 Thread chromatic
On Thursday 22 February 2007 12:53, Andy Lester wrote: > Would there be an option to specify where to find the mocked libs, > rather than assuming t/lib? But: use mocked 't/some_other_lib/' SomeModule; ... isn't all that much shorter than: use lib 't/some_other_lib'; us

Re: use mocked

2007-02-22 Thread Andy Lester
On Feb 22, 2007, at 2:49 PM, Luke Closs wrote: So I just hacked up mocked.pm, which will only load libraries from t/lib. The above example would look like: use mocked 'LWP::Simple'; Would there be an option to specify where to find the mocked libs, rather than assuming t/lib? -- Andy

use mocked

2007-02-22 Thread Luke Closs
Hey everyone, I was writing unit tests for some code, and needed to mock up a library, something that I've done many times before. I usually put my mock libraries into 't/lib', and then do something like this: use lib 't/lib'; use LWP::Simple; # this is a mocked library This works pretty wel