X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Funit_core_script_server.t;h=27e01afede5ab53b953a94c9a08ff0da21bf4656;hb=960bf5b030405f078f8543acf7aac5f0791ae27d;hp=b2ea3f9b25229db3975142955780cabd2db8fb3a;hpb=4f0612fdbc3922b6b32f9f30269849a51995b4f3;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/unit_core_script_server.t b/t/aggregate/unit_core_script_server.t index b2ea3f9..27e01af 100644 --- a/t/aggregate/unit_core_script_server.t +++ b/t/aggregate/unit_core_script_server.t @@ -27,31 +27,24 @@ testOption( [ qw/-p 3001/ ], ['3001', 'localhost', opthash()] ); testOption( [ qw/--port 3001/ ], ['3001', 'localhost', opthash()] ); # fork -f -fork --fork -f --fork -$testopts = opthash(); -$testopts->{fork} = 1; -testOption( [ qw/--fork/ ], ['3000', 'localhost', $testopts] ); -testOption( [ qw/-f/ ], ['3000', 'localhost', $testopts] ); +testOption( [ qw/--fork/ ], ['3000', 'localhost', opthash(fork => 1)] ); +testOption( [ qw/-f/ ], ['3000', 'localhost', opthash(fork => 1)] ); # pidfile -pidfile --pid --pidfile -$testopts = opthash(); -$testopts->{pidfile} = "cat.pid"; -testOption( [ qw/--pidfile cat.pid/ ], ['3000', 'localhost', $testopts] ); +testOption( [ qw/--pidfile cat.pid/ ], ['3000', 'localhost', opthash(pidfile => "cat.pid")] ); +testOption( [ qw/--pid cat.pid/ ], ['3000', 'localhost', opthash(pidfile => "cat.pid")] ); # keepalive -k -keepalive --keepalive -k --keepalive -$testopts = opthash(); -$testopts->{keepalive} = 1; -testOption( [ qw/-k/ ], ['3000', 'localhost', $testopts] ); -testOption( [ qw/--keepalive/ ], ['3000', 'localhost', $testopts] ); +testOption( [ qw/-k/ ], ['3000', 'localhost', opthash(keepalive => 1)] ); +testOption( [ qw/--keepalive/ ], ['3000', 'localhost', opthash(keepalive => 1)] ); # symlinks -follow_symlinks --sym --follow_symlinks -$testopts = opthash(); -$testopts->{follow_symlinks} = 1; -testOption( [ qw/--follow_symlinks/ ], ['3000', 'localhost', $testopts] ); +testOption( [ qw/--follow_symlinks/ ], ['3000', 'localhost', opthash(follow_symlinks => 1)] ); +testOption( [ qw/--sym/ ], ['3000', 'localhost', opthash(follow_symlinks => 1)] ); # background -background --bg --background -$testopts = opthash(); -$testopts->{background} = 1; -testOption( [ qw/--background/ ], ['3000', 'localhost', $testopts] ); +testOption( [ qw/--background/ ], ['3000', 'localhost', opthash(background => 1)] ); +testOption( [ qw/--bg/ ], ['3000', 'localhost', opthash(background => 1)] ); # Restart stuff requires a threaded perl, apparently. # restart -r -restart --restart -R --restart @@ -80,10 +73,12 @@ sub testOption { # Returns the hash expected when no flags are passed sub opthash { - return { 'pidfile' => undef, - 'fork' => 0, - 'follow_symlinks' => 0, - 'background' => 0, - 'keepalive' => 0, - } + return { + 'pidfile' => undef, + 'fork' => 0, + 'follow_symlinks' => 0, + 'background' => 0, + 'keepalive' => 0, + @_, + }; }