Devel::Cover recommendations... or maybe not?
David Cantrell
david at cantrell.org.uk
Thu Mar 15 17:16:16 GMT 2007
On Thu, Mar 15, 2007 at 04:26:18PM +0000, Adrian Howard wrote:
> Chapter 5 of "Perl Testing: A Developer's Notebook" (Testing
> Untestable Code) has a nice overview of this sort of thing.
On which subject, anyone got a HOWTO for Test::MockObject or
Test::Mock::LWP?
As far as I can tell, this:
use Test::MockObject;
my $mockedmodule = Test::MockObject->new();
$mockedmodule->fake_module(
'MockedModule',
new => sub { $mockedmodule },
randommethod => sub { print 'i like pie' }
);
MockedModule->new()->randommethod();
should mumble about pie. Instead, it mumbles:
Un-mocked method 'randommethod()' called at ...
--
David Cantrell | Hero of the Information Age
Deck of Cards: $1.29.
"101 Solitaire Variations" book: $6.59.
Cheap replacement for the one thing Windows is good at: priceless
-- Shane Lazarus
More information about the london.pm
mailing list