Merge branch 'master' into psgi
[catagits/Catalyst-Runtime.git] / t / aggregate / unit_core_script_fastcgi.t
index 6ffee95..06300f5 100644 (file)
@@ -19,8 +19,8 @@ testOption( [ qw|-l /tmp/foo| ], ['/tmp/foo', opthash()] );
 testOption( [ qw/-l 127.0.0.1:3000/ ], ['127.0.0.1:3000', opthash()] );
 
 #daemonize           -d --daemon
-testOption( [ qw/-d/ ], [undef, opthash()] );
-testOption( [ qw/--daemon/ ], [undef, opthash()] );
+testOption( [ qw/-d/ ], [undef, opthash(detach => 1)] );
+testOption( [ qw/--daemon/ ], [undef, opthash(detach => 1)] );
 
 # pidfile        -pidfile -p                 --pid --pidfile
 testOption( [ qw/--pidfile cat.pid/ ], [undef, opthash(pidfile => 'cat.pid')] );
@@ -39,9 +39,9 @@ testOption( [ qw/-e/ ], [undef, opthash(keep_stderr => 1)] );
 testOption( [ qw/--nproc 6/ ], [undef, opthash(nproc => 6)] );
 testOption( [ qw/--n 6/ ], [undef, opthash(nproc => 6)] );
 
-# detach
-testOption( [ qw/--detach/ ], [undef, opthash(detach => 1)] );
-testOption( [ qw/--det/ ], [undef, opthash(detach => 1)] );
+# title
+testOption( [ qw/--title foo/ ], [undef, opthash(title => 'foo')] );
+testOption( [ qw/-t foo/ ], [undef, opthash(title => 'foo')] );
 
 done_testing;
 
@@ -55,17 +55,16 @@ sub testOption {
     } "new_with_options";
     # First element of RUN_ARGS will be the script name, which we don't care about
     shift @TestAppToTestScripts::RUN_ARGS;
+    my $server = pop @TestAppToTestScripts::RUN_ARGS;
+    like ref($server), qr/^Plack::Handler/, 'Is a Plack::Handler';
     is_deeply \@TestAppToTestScripts::RUN_ARGS, $resultarray, "is_deeply comparison";
 }
 
 # Returns the hash expected when no flags are passed
 sub opthash {
     return {
-        pidfile => undef,
-        keep_stderr => undef,
-        detach => undef,
-        nproc => undef,
-        manager => undef,
+        (map { ($_ => undef) } qw(pidfile keep_stderr detach nproc manager)),
+        title => 'perl-fcgi-pm [TestAppToTestScripts]',
         @_,
     };
 }