From: Tomas Doran Date: Sun, 27 Mar 2011 11:17:47 +0000 (+0100) Subject: Test showing how having a .psgi file will ruin your day X-Git-Tag: 5.89003~77 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=a6f3a029c29d53913d3ab7dcc851b09d554254ff Test showing how having a .psgi file will ruin your day --- diff --git a/t/psgi_file_testapp.t b/t/psgi_file_testapp.t new file mode 100644 index 0000000..b13464f --- /dev/null +++ b/t/psgi_file_testapp.t @@ -0,0 +1,33 @@ +use strict; +use warnings; +no warnings 'once'; +use FindBin qw/$Bin/; +use lib "$Bin/lib"; + +use Test::More; + +use File::Spec; +use File::Temp qw/ tempdir /; + +my $temp; +BEGIN { + $temp = tempdir( CLEANUP => 1 ); + + $ENV{CATALYST_HOME} = $temp; + open(my $psgi, '>', File::Spec->catdir($temp, 'testapp.psgi')) or die; + print $psgi q{ + use strict; + use TestApp; + + $main::have_loaded_psgi = 1; + my $app = sub { TestApp->psgi_app(@_) }; + }; + close($psgi); +} +use Catalyst::Test qw/ TestApp /; + +ok $main::have_loaded_psgi; +ok request('/'); + +done_testing; +