X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestApp.pm;h=e14e3dc0d199054351b9a8a4423b6909e08f52b6;hb=009b5b2324f83396439a494a56684efb60eb2cd8;hp=e9e7e59c461e76cafa63198a978a219611f6e3c6;hpb=3d101ef947ea1bb88451a626a3b9749952f55fbd;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestApp.pm b/t/lib/TestApp.pm index e9e7e59..e14e3dc 100644 --- a/t/lib/TestApp.pm +++ b/t/lib/TestApp.pm @@ -13,10 +13,32 @@ use Catalyst qw/ /; use Catalyst::Utils; +use Moose; +use namespace::autoclean; + our $VERSION = '0.01'; TestApp->config( name => 'TestApp', root => '/some/dir' ); +if (eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) { + with 'CatalystX::LeakChecker'; + + has leaks => ( + is => 'ro', + default => sub { [] }, + ); +} + +sub found_leaks { + my ($ctx, @leaks) = @_; + push @{ $ctx->leaks }, @leaks; +} + +sub count_leaks { + my ($ctx) = @_; + return scalar @{ $ctx->leaks }; +} + TestApp->setup; sub index : Private {