From: Andy Grundman Date: Tue, 7 Nov 2006 16:48:50 +0000 (+0000) Subject: Fixed lighttpd tests to not load File::Slurp until run-time X-Git-Tag: 5.7099_04~291 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=381e2cab022817530b18712d6a7194eb33c6842a Fixed lighttpd tests to not load File::Slurp until run-time --- diff --git a/t/optional_lighttpd-fastcgi-non-root.t b/t/optional_lighttpd-fastcgi-non-root.t index a28afe7..d0a1183 100644 --- a/t/optional_lighttpd-fastcgi-non-root.t +++ b/t/optional_lighttpd-fastcgi-non-root.t @@ -15,12 +15,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"; @@ -72,7 +74,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: $!"; diff --git a/t/optional_lighttpd-fastcgi.t b/t/optional_lighttpd-fastcgi.t index ff7a2ea..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"; @@ -72,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: $!";