X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Foptional_lighttpd-fastcgi.t;h=6b084cded1c601bcd761c27ba0e31bd443f0f7eb;hb=69eecfe56af710d0698539ea25dc1bc84282e013;hp=286c277fa6c568214dd747c1d6bcc4ca94c2365e;hpb=5884ba38ab9f8931d211df9d718dc7f31227ff1f;p=catagits%2FCatalyst-Runtime.git diff --git a/t/optional_lighttpd-fastcgi.t b/t/optional_lighttpd-fastcgi.t index 286c277..6b084cd 100644 --- a/t/optional_lighttpd-fastcgi.t +++ b/t/optional_lighttpd-fastcgi.t @@ -4,7 +4,6 @@ use strict; use warnings; use File::Path; -use File::Slurp qw(write_file); use FindBin; use IO::Socket; use Test::More; @@ -15,12 +14,14 @@ plan skip_all => 'Catalyst::Devel required' if $@; eval "use File::Copy::Recursive"; plan skip_all => 'File::Copy::Recursive required' if $@; -my $lighttpd_bin = $ENV{LIGHTTPD_BIN} || 'lighttpd'; -plan skip_all => 'Cannot find lighttpd, please set LIGHTTPD_BIN' - unless -x $lighttpd_bin; +my $lighttpd_bin = $ENV{LIGHTTPD_BIN}; +plan skip_all => 'Please set LIGHTTPD_BIN to run this test' + unless $lighttpd_bin && -x $lighttpd_bin; plan tests => 1; +require File::Slurp; + # clean up rmtree "$FindBin::Bin/../t/tmp" if -d "$FindBin::Bin/../t/tmp"; @@ -54,6 +55,7 @@ server.document-root = "$docroot" server.errorlog = "$docroot/error.log" accesslog.filename = "$docroot/access.log" +server.bind = "127.0.0.1" server.port = $port # catalyst app specific fcgi setup @@ -71,7 +73,7 @@ fastcgi.server = ( ) }; -write_file "$docroot/lighttpd.conf", $conf; +File::Slurp::write_file( "$docroot/lighttpd.conf", $conf ); my $pid = open my $lighttpd, "$lighttpd_bin -D -f $docroot/lighttpd.conf 2>&1 |" or die "Unable to spawn lighttpd: $!"; @@ -82,8 +84,6 @@ while ( check_port( 'localhost', $port ) != 1 ) { sleep 1; } -exit; - # run the testsuite against the server $ENV{CATALYST_SERVER} = "http://localhost:$port"; system( 'prove -r -Ilib/ t/live_*' );