- And added the files I missed first time round
Matt S Trout [Fri, 2 Dec 2005 21:15:28 +0000 (21:15 +0000)]
t/06includepath.t [new file with mode: 0644]
t/lib/TestApp/View/TT/Includepath.pm [new file with mode: 0644]
t/lib/TestApp/root/test_include_path/testpath.tt [new file with mode: 0644]

diff --git a/t/06includepath.t b/t/06includepath.t
new file mode 100644 (file)
index 0000000..f6b5304
--- /dev/null
@@ -0,0 +1,17 @@
+use strict;
+use warnings;
+use Test::More tests => 5;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use_ok('Catalyst::Test', 'TestApp');
+my $response;
+
+ok(($response = request("/test_includepath?view=Appconfig&template=testpath.tt&additionalpath=test_include_path"))->is_success, 'request ok');
+is($response->content, TestApp->config->{default_message}, 'message ok');
+
+
+ok(($response = request("/test_includepath?view=Includepath&template=testpath.tt"))->is_success, 'request ok');
+is($response->content, TestApp->config->{default_message}, 'message ok');
+
diff --git a/t/lib/TestApp/View/TT/Includepath.pm b/t/lib/TestApp/View/TT/Includepath.pm
new file mode 100644 (file)
index 0000000..0d8756d
--- /dev/null
@@ -0,0 +1,16 @@
+package TestApp::View::TT::Includepath;
+
+use FindBin;
+use Path::Class;
+use strict;
+use base 'Catalyst::View::TT';
+
+my $includepath = dir($FindBin::Bin, '/lib/TestApp/root/test_include_path');
+__PACKAGE__->config(
+    PRE_CHOMP          => 1,
+    POST_CHOMP         => 1,
+    TEMPLATE_EXTENSION => '.tt',
+    INCLUDE_PATH        => "aaa:$includepath",
+);
+
+1;
diff --git a/t/lib/TestApp/root/test_include_path/testpath.tt b/t/lib/TestApp/root/test_include_path/testpath.tt
new file mode 100644 (file)
index 0000000..4a0a2d8
--- /dev/null
@@ -0,0 +1 @@
+[% message %]