From: Robert Buels Date: Tue, 5 Oct 2010 21:27:20 +0000 (-0700) Subject: added failing test for specifying cgi_dir with MyApp->path_to X-Git-Tag: 0.031~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Controller-WrapCGI.git;a=commitdiff_plain;h=f050749c80a961663b868104f4b4149bf854a027;hp=7d24dda254e10146da1f6f4d4177af99782eafe1 added failing test for specifying cgi_dir with MyApp->path_to --- diff --git a/t/cgibin_root_path.t b/t/cgibin_root_path.t index 7a17595..20c0e62 100644 --- a/t/cgibin_root_path.t +++ b/t/cgibin_root_path.t @@ -6,7 +6,7 @@ use warnings; use FindBin '$Bin'; use lib "$Bin/lib"; -use Test::More tests => 2; +use Test::More tests => 3; # Test configurable path root and dir { package root_test; @@ -37,3 +37,18 @@ use Test::More tests => 2; is($response->content, 'foo:bar bar:baz', 'POST to Perl CGI File 2'); } + +# test yet another variation on specifying the root path +{ package root_test_3; + + use Test::More; + use HTTP::Request::Common; + use Catalyst::Test 'TestCGIBinRoot3'; + + my $response = request POST '/cgi/path/test.pl', [ + foo => 'bar', + bar => 'baz' + ]; + + is($response->content, 'foo:bar bar:baz', 'POST to Perl CGI File 3'); +} diff --git a/t/lib/TestCGIBinRoot3.pm b/t/lib/TestCGIBinRoot3.pm new file mode 100644 index 0000000..df84c92 --- /dev/null +++ b/t/lib/TestCGIBinRoot3.pm @@ -0,0 +1,8 @@ +package TestCGIBinRoot3; + +use Catalyst::Runtime '5.70'; +use parent 'Catalyst'; + +__PACKAGE__->setup(qw/Static::Simple/); + +1; diff --git a/t/lib/TestCGIBinRoot3/Controller/CGIHandler.pm b/t/lib/TestCGIBinRoot3/Controller/CGIHandler.pm new file mode 100644 index 0000000..26d826e --- /dev/null +++ b/t/lib/TestCGIBinRoot3/Controller/CGIHandler.pm @@ -0,0 +1,11 @@ +package TestCGIBinRoot3::Controller::CGIHandler; + +use parent 'Catalyst::Controller::CGIBin'; + +__PACKAGE__->config( + cgi_root_path => 'cgi', + cgi_dir => TestCGIBinRoot3->path_to('root','cgi'), + ); + + +1; diff --git a/t/lib/TestCGIBinRoot3/root/cgi/path/test.pl b/t/lib/TestCGIBinRoot3/root/cgi/path/test.pl new file mode 100755 index 0000000..0486369 --- /dev/null +++ b/t/lib/TestCGIBinRoot3/root/cgi/path/test.pl @@ -0,0 +1,11 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use CGI ':standard'; + +die '$ENV{MOD_PERL} must not be set' if $ENV{MOD_PERL}; + +print header; +print 'foo:',param('foo'),' bar:',param('bar')