[Catalyst] Mocking for Catalyst testing

Tomas Doran bobtfish at bobtfish.net
Sun Jan 17 03:31:05 GMT 2010


On 16 Jan 2010, at 23:56, Stuart Watt wrote:
> Does anyone have a good recipe for mocking Catalyst components? Any  
> suggestions for good tools/modules to use?

I tend to just use Moose directly to construct mock classes for me:

my $meta = Class::MOP::Class->make_anon_class( superclasses =>  
['Moose::Object']);
$meta->add_method(foo => sub {...});
... etc ...
my $i = $meta->name->new;
# And go :)

Cheers
t0m




More information about the Catalyst mailing list