Refreshing branch
[catagits/Catalyst-Runtime.git] / trunk / t / live_component_controller_context_closure.t
diff --git a/trunk/t/live_component_controller_context_closure.t b/trunk/t/live_component_controller_context_closure.t
new file mode 100644 (file)
index 0000000..172f91e
--- /dev/null
@@ -0,0 +1,28 @@
+use strict;
+use warnings;
+use Test::More;
+
+BEGIN {
+    unless (eval 'use CatalystX::LeakChecker 0.03; 1') {
+        plan skip_all => 'CatalystX::LeakChecker 0.03 required for this test';
+    }
+
+    plan tests => 4;
+}
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Catalyst::Test 'TestApp';
+
+{
+    my ($resp, $ctx) = ctx_request('/contextclosure/normal_closure');
+    ok($resp->is_success);
+    is($ctx->count_leaks, 1);
+}
+
+{
+    my ($resp, $ctx) = ctx_request('/contextclosure/context_closure');
+    ok($resp->is_success);
+    is($ctx->count_leaks, 0);
+}