poked at t/start_dev_server.t
Devin Austin [Thu, 25 Jun 2009 02:15:18 +0000 (02:15 +0000)]
corrected Server to start with HTTP not CGI

lib/Catalyst/Script/Server.pm
t/start_dev_server.t

index 859721a..01a066f 100644 (file)
@@ -10,14 +10,18 @@ use namespace::clean -except => [ qw(meta) ];
 
 with 'MooseX::Getopt';
 
-has help        => ( isa => 'Bool',   is => 'ro', required => 0, default => sub { 0 } );
-has host        => ( isa => 'Str',    is => 'ro', required => 0 );
-has fork        => ( isa => 'Bool',   is => 'ro', required => 0 );
-has listen      => ( isa => 'Int',    is => 'ro', required => 0, default => sub{ 3000 } );
-has pidfile     => ( isa => 'Str',    is => 'ro', required => 0 );
-has keepalive   => ( isa => 'Bool',   is => 'ro', required => 0, default => sub { 0 } );
-has background  => ( isa => 'Bool',   is => 'ro', required => 0 );
-has app         => ( isa => 'Str',    is => 'ro', required => 1 );
+has help            => ( isa => 'Bool',   is => 'ro', required => 0, default => sub { 0 } );
+has host            => ( isa => 'Str',    is => 'ro', required => 0, default => sub { "localhost" } );
+has fork            => ( isa => 'Bool',   is => 'ro', required => 0 );
+has listen          => ( isa => 'Int',    is => 'ro', required => 0, default => sub{ 3000 } );
+has pidfile         => ( isa => 'Str',    is => 'ro', required => 0 );
+has keepalive       => ( isa => 'Bool',   is => 'ro', required => 0, default => sub { 0 } );
+has background      => ( isa => 'Bool',   is => 'ro', required => 0 );
+has app             => ( isa => 'Str',    is => 'ro', required => 1 );
+has restart         => ( isa => 'Bool',   is => 'ro', required => 0 );
+has restart_delay   => ( isa => 'Int',    is => 'ro', required => 0 );
+has restart_regex   => ( isa => 'Str',    is => 'ro', required => 0 );
+has follow_symlinks => ( isa => 'Bool',   is => 'ro', required => 0 );
 
 my @argv = @ARGV;
 
@@ -34,6 +38,12 @@ sub run {
            keepalive  => $self->keepalive,
            background => $self->background,
            pidfile    => $self->pidfile,
+           keepalive         => $self->keepalive,
+           restart           => $self->restart,
+           restart_delay     => $self->restart_delay,
+           restart_regex     => qr/$self->restart_regex/,
+           restart_directory => $self->restart_directory,
+           follow_symlinks   => $self->follow_symlinks,
         }  
     );
 
index b6f12b2..6b54c28 100644 (file)
@@ -7,6 +7,8 @@ use FindBin qw/$Bin/;
 use File::Spec;
 use lib "$Bin/TestApp/lib";
 use TestApp;
+use Catalyst::Test 'TestApp', {default_host => 'default.com'};
+use Catalyst::Request;
 use Test::WWW::Mechanize;
 BEGIN { 
     $ENV{CATALYST_ENGINE} ||= 'HTTP';
@@ -23,7 +25,7 @@ my $childpid = fork();
 die "fork() error, cannot continue" unless defined($childpid);
 
 if ($childpid == 0) {
-  system("$^X $server_path -p $port > $devnull 2>&1");
+  system("$^X $server_path --listen $port > $devnull 2>&1");
   exit; # just for sure; we should never got here
 }