Test::MockObject? What is that? How do I use? Why??? [Was: Devel::Cover recommendations...]
Luis Motta Campos
luismottacampos at yahoo.co.uk
Mon Mar 19 08:40:12 GMT 2007
On Mar 17, 2007, at 9:40 PM, Adrian Howard wrote:
> I think you want something like...
>
> use Test::MockObject;
> my $mock = Test::MockObject->new->
> mock( randommethod => sub { print "i like pie\n" } );
> $mock->fake_module( 'MockedModule' );
> $mock->fake_new( 'MockedModule' );
>
> MockedModule->new->randommethod;
Please don't laught, but I can't see any good reason to use this
on a test.
Mr. Cantrell, could you please tell me how are you using this and
why?
Pointers and RTFM (with manual name) are welcome. ;-)
--
Luis Motta Campos (a.k.a. Monsieur Champs) is a software engineer,
Perl fanatic evangelist, and amateur {cook, photographer}
More information about the london.pm
mailing list