use FindBin '$Bin';
use lib "$Bin/lib";
-use Test::More tests => 1;
-
-use Catalyst::Test 'TestCGIBinRoot';
-use HTTP::Request::Common;
+use Test::More tests => 2;
# Test configurable path root and dir
+{ package root_test;
+
+ use Test::More;
+ use HTTP::Request::Common;
+ use Catalyst::Test 'TestCGIBinRoot';
+
+ my $response = request POST '/cgi/path/test.pl', [
+ foo => 'bar',
+ bar => 'baz'
+ ];
+
+ is($response->content, 'foo:bar bar:baz', 'POST to Perl CGI File');
+}
+
+# test another variation on specifying the root path
+{ package another_root_test;
+
+ use Test::More;
+ use HTTP::Request::Common;
+ use Catalyst::Test 'TestCGIBinRoot2';
-my $response = request POST '/cgi/path/test.pl', [
- foo => 'bar',
- bar => 'baz'
-];
+ my $response = request POST '/cgi/path/test.pl', [
+ foo => 'bar',
+ bar => 'baz'
+ ];
-is($response->content, 'foo:bar bar:baz', 'POST to Perl CGI File');
+ is($response->content, 'foo:bar bar:baz', 'POST to Perl CGI File 2');
+}
--- /dev/null
+package TestCGIBinRoot2;
+
+use Catalyst::Runtime '5.70';
+use parent 'Catalyst';
+
+__PACKAGE__->config({
+ root => 'another_root',
+ Controller::CGIHandler => {
+ cgi_root_path => 'cgi',
+ cgi_dir => 'cgi'
+ }
+});
+
+__PACKAGE__->setup(qw/Static::Simple/);
+
+1;