X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Funit_core_script_fastcgi.t;h=27f245ac341cd1a1932de1cb7cc34e4d33921142;hb=d4f76f02f299906d23b02bb4bb4007de437a8747;hp=534b319fa353bd07c6bf13fde1a890cd25c6cfeb;hpb=78dc94f2bbf5738c2eb2632d54e358b249812eb2;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/unit_core_script_fastcgi.t b/t/aggregate/unit_core_script_fastcgi.t index 534b319..27f245a 100644 --- a/t/aggregate/unit_core_script_fastcgi.t +++ b/t/aggregate/unit_core_script_fastcgi.t @@ -19,12 +19,13 @@ 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 --pid --pidfile +# pidfile -pidfile -p --pid --pidfile testOption( [ qw/--pidfile cat.pid/ ], [undef, opthash(pidfile => 'cat.pid')] ); testOption( [ qw/--pid cat.pid/ ], [undef, opthash(pidfile => 'cat.pid')] ); +testOption( [ qw/-p cat.pid/ ], [undef, opthash(pidfile => 'cat.pid')] ); # manager testOption( [ qw/--manager foo::bar/ ], [undef, opthash(manager => 'foo::bar')] ); @@ -38,28 +39,22 @@ 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)] ); +# proc_title +testOption( [ qw/--proc_title foo/ ], [undef, opthash(proc_title => 'foo')] ); done_testing; sub testOption { my ($argstring, $resultarray) = @_; - subtest "Test for ARGV: @$argstring" => sub - { - plan tests => 2; - local @ARGV = @$argstring; - local @TestAppToTestScripts::RUN_ARGS; - lives_ok { - Catalyst::Script::FastCGI->new_with_options(application_name => 'TestAppToTestScripts')->run; - } "new_with_options"; - # First element of RUN_ARGS will be the script name, which we don't care about - shift @TestAppToTestScripts::RUN_ARGS; - is_deeply \@TestAppToTestScripts::RUN_ARGS, $resultarray, "is_deeply comparison"; - done_testing; - }; + local @ARGV = @$argstring; + local @TestAppToTestScripts::RUN_ARGS; + lives_ok { + Catalyst::Script::FastCGI->new_with_options(application_name => 'TestAppToTestScripts')->run; + } "new_with_options"; + # First element of RUN_ARGS will be the script name, which we don't care about + shift @TestAppToTestScripts::RUN_ARGS; + is_deeply \@TestAppToTestScripts::RUN_ARGS, $resultarray, "is_deeply comparison"; } # Returns the hash expected when no flags are passed @@ -70,6 +65,7 @@ sub opthash { detach => undef, nproc => undef, manager => undef, + proc_title => undef, @_, }; }