adding a failing test -- under dev server, fork() doesn't work
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Fork.pm
diff --git a/t/lib/TestApp/Controller/Fork.pm b/t/lib/TestApp/Controller/Fork.pm
new file mode 100644 (file)
index 0000000..fb71c7c
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+# Fork.pm 
+# Copyright (c) 2006 Jonathan Rockway <jrockway@cpan.org>
+
+package TestApp::Controller::Fork;
+
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+use YAML;
+
+sub fork : Global {
+    my ($self, $c, $ls) = @_;
+    my ($result, $code) = (undef, 1);
+
+    if(!-e $ls || !-x _){ 
+       $result = 'skip';
+       $code = 0;
+    }
+    else {
+       $result = system($ls, $ls, $ls);
+       $code = $?;
+    }
+    
+    $c->response->body(Dump({result => $result, code => $code}));
+}
+
+1;