[Catalyst-commits] r10649 - in
Catalyst-Runtime/5.80/branches/better_scripts: lib/Catalyst/Script t
dhoss at dev.catalyst.perl.org
dhoss at dev.catalyst.perl.org
Thu Jun 25 01:10:57 GMT 2009
Author: dhoss
Date: 2009-06-25 01:10:57 +0000 (Thu, 25 Jun 2009)
New Revision: 10649
Added:
Catalyst-Runtime/5.80/branches/better_scripts/t/start_dev_server.t
Modified:
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/Create.pm
Log:
added dev_server test, poked Catalyst::Script::Create
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/Create.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/Create.pm 2009-06-25 01:05:10 UTC (rev 10648)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/Create.pm 2009-06-25 01:10:57 UTC (rev 10649)
@@ -1,3 +1,3 @@
package Catalyst::Script::Create;
-
+use Moose;
1;
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/start_dev_server.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/start_dev_server.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/start_dev_server.t 2009-06-25 01:10:57 UTC (rev 10649)
@@ -0,0 +1,32 @@
+use Test::More tests => 1;
+use strict;
+use warnings;
+use Catalyst::Engine::HTTP;
+use File::Temp qw/ tempdir tmpnam /;
+use FindBin qw/$Bin/;
+use File::Spec;
+use lib "$Bin/TestApp/lib";
+use TestApp;
+use Test::WWW::Mechanize;
+
+my $dir = tempdir(); # CLEANUP => 1 );
+my $devnull = File::Spec->devnull;
+
+my $server_path = File::Spec->catfile('script', 'testapp_server.pl');
+my $port = int(rand(10000)) + 40000; # get random port between 40000-50000
+
+my $childpid = fork();
+die "fork() error, cannot continue" unless defined($childpid);
+
+if ($childpid == 0) {
+ system("$^X $server_path -p $port > $devnull 2>&1");
+ exit; # just for sure; we should never got here
+}
+
+sleep 10; #wait for catalyst application to start
+my $mech = Test::WWW::Mechanize->new;
+$mech->get_ok( "http://localhost:" . $port );
+
+kill 'KILL', $childpid;
+
+
More information about the Catalyst-commits
mailing list