X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestApp.pm;h=e14e3dc0d199054351b9a8a4423b6909e08f52b6;hb=3433ebccdb24e3104817fe633522039965b375c5;hp=0d03647fa56bdde727a24f55c46ea74198edb915;hpb=ccb6cad7c8e8d19f4a8a57dcc37bf15b1d2efa18;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestApp.pm b/t/lib/TestApp.pm index 0d03647..e14e3dc 100644 --- a/t/lib/TestApp.pm +++ b/t/lib/TestApp.pm @@ -2,7 +2,7 @@ package TestApp; use strict; use Catalyst qw/ - MangleDollarUnderScore + Test::MangleDollarUnderScore Test::Errors Test::Headers Test::Plugin @@ -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 {