[Catalyst-commits] r11923 - Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Thu Nov 19 23:48:43 GMT 2009


Author: t0m
Date: 2009-11-19 23:48:42 +0000 (Thu, 19 Nov 2009)
New Revision: 11923

Modified:
   Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/unit_core_script_server.t
Log:
Cleanup and some moar tests

Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/unit_core_script_server.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/unit_core_script_server.t	2009-11-19 23:32:24 UTC (rev 11922)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/unit_core_script_server.t	2009-11-19 23:48:42 UTC (rev 11923)
@@ -27,31 +27,24 @@
 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 @@
 
 # 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,
+        @_,
+    };
 }




More information about the Catalyst-commits mailing list