I'm an idiot, that totally doesn't work. remove.
[catagits/Catalyst-Runtime.git] / t / lib / TestApp.pm
index 0d03647..321f78e 100644 (file)
@@ -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 {
@@ -55,7 +77,7 @@ sub execute {
             @executed
         );
     }
-
+    no warnings 'recursion';
     return $c->SUPER::execute(@_);
 }
 
@@ -85,6 +107,7 @@ sub loop_test : Local {
 
 sub recursion_test : Local {
     my ( $self, $c ) = @_;
+    no warnings 'recursion';
     $c->forward( 'recursion_test' );
 }