From: Jonathan Rockway Date: Thu, 9 Nov 2006 06:53:18 +0000 (+0000) Subject: eliminate file::slurp dependency X-Git-Tag: 5.7099_04~281 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=3f5f2699dc0cb69fbb435bd748d2ac12466f182d eliminate file::slurp dependency --- diff --git a/t/optional_lighttpd-fastcgi-non-root.t b/t/optional_lighttpd-fastcgi-non-root.t index d0a1183..5618014 100644 --- a/t/optional_lighttpd-fastcgi-non-root.t +++ b/t/optional_lighttpd-fastcgi-non-root.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; @@ -21,8 +20,6 @@ plan skip_all => 'Please set LIGHTTPD_BIN to run this test' plan tests => 1; -require File::Slurp; - # clean up rmtree "$FindBin::Bin/../t/tmp" if -d "$FindBin::Bin/../t/tmp"; @@ -43,7 +40,7 @@ my $port = 8529; # Clean up docroot path $docroot =~ s{/t/..}{}; -my $conf = qq{ +my $conf = <<"END"; # basic lighttpd config file for testing fcgi+catalyst server.modules = ( "mod_access", @@ -72,9 +69,11 @@ fastcgi.server = ( ) ) ) -}; +END -File::Slurp::write_file( "$docroot/lighttpd.conf", $conf ); +open(my $lightconf, '>', "$docroot/lighttpd.conf") or die "Can't open $docroot/lighttpd.conf: $!"; +print {$lightconf} $conf or die "Write error: $!"; +close $lightconf; my $pid = open my $lighttpd, "$lighttpd_bin -D -f $docroot/lighttpd.conf 2>&1 |" or die "Unable to spawn lighttpd: $!"; @@ -113,4 +112,4 @@ sub check_port { else { return 0; } -} \ No newline at end of file +} diff --git a/t/optional_lighttpd-fastcgi.t b/t/optional_lighttpd-fastcgi.t index 6b084cd..c6be094 100644 --- a/t/optional_lighttpd-fastcgi.t +++ b/t/optional_lighttpd-fastcgi.t @@ -20,8 +20,6 @@ plan skip_all => 'Please set LIGHTTPD_BIN to run this test' plan tests => 1; -require File::Slurp; - # clean up rmtree "$FindBin::Bin/../t/tmp" if -d "$FindBin::Bin/../t/tmp"; @@ -42,7 +40,7 @@ my $port = 8529; # Clean up docroot path $docroot =~ s{/t/..}{}; -my $conf = qq{ +my $conf = <<"END"; # basic lighttpd config file for testing fcgi+catalyst server.modules = ( "mod_access", @@ -71,9 +69,11 @@ fastcgi.server = ( ) ) ) -}; +END -File::Slurp::write_file( "$docroot/lighttpd.conf", $conf ); +open(my $lightconf, '>', "$docroot/lighttpd.conf") or die "Can't open $docroot/lighttpd.conf: $!"; +print {$lightconf} $conf or die "Write error: $!"; +close $lightconf; my $pid = open my $lighttpd, "$lighttpd_bin -D -f $docroot/lighttpd.conf 2>&1 |" or die "Unable to spawn lighttpd: $!"; @@ -112,4 +112,4 @@ sub check_port { else { return 0; } -} \ No newline at end of file +}