X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Foptional_http-server-restart.t;h=ff7049d17e7d13c24dee4a8aec53db28c1ad0cb7;hp=9d58e08cfdce45fd66621feb4fcb9477e7b2b948;hb=8ae46e9876d7f0285d7a71eb3669a593a26ef4bb;hpb=f3d2ec61cac867693834d3093c9dff7891e3e3f5 diff --git a/t/optional_http-server-restart.t b/t/optional_http-server-restart.t index 9d58e08..ff7049d 100644 --- a/t/optional_http-server-restart.t +++ b/t/optional_http-server-restart.t @@ -14,29 +14,16 @@ use LWP::Simple; use IO::Socket; use IPC::Open3; use Time::HiRes qw/sleep/; -eval {require Catalyst::Devel; Catalyst::Devel->VERSION(1.0);}; -plan skip_all => 'Catalyst::Devel required' if $@; -plan skip_all => 'Catalyst::Devel >= 1.04 required' if $Catalyst::Devel::VERSION <= 1.03; -eval "use File::Copy::Recursive"; -plan skip_all => 'File::Copy::Recursive required' if $@; - -my $tmpdir = "$FindBin::Bin/../t/tmp"; - -# clean up -rmtree $tmpdir if -d $tmpdir; - -# create a TestApp and copy the test libs into it -mkdir $tmpdir; -chdir $tmpdir; - -system( $^X, "-I$FindBin::Bin/../lib", '-MFile::Spec', '-e', "\@ARGV=('TestApp'); my \$devnull = File::Spec->devnull; open my \$fh, '>', \$devnull or die \"Cannot write to \$devnull: \$!\"; *STDOUT = \$fh; do \"$FindBin::Bin/../script/catalyst.pl\""); +BEGIN { + eval "use File::Copy::Recursive"; + plan skip_all => 'File::Copy::Recursive required' if $@; +} -chdir "$FindBin::Bin/.."; -File::Copy::Recursive::dircopy( 't/lib', 't/tmp/TestApp/lib' ); +use lib 't/lib'; +use MakeTestApp; -# remove TestApp's tests -rmtree 't/tmp/TestApp/t'; +make_test_app; # spawn the standalone HTTP server my $port = 30000 + int rand( 1 + 10000 );