From: Matt S Trout Date: Fri, 2 Dec 2005 21:15:28 +0000 (+0000) Subject: - And added the files I missed first time round X-Git-Tag: v0.30~48 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=425f7060292715621cf98c17d37a736b72c43453;p=catagits%2FCatalyst-View-TT.git - And added the files I missed first time round --- diff --git a/t/06includepath.t b/t/06includepath.t new file mode 100644 index 0000000..f6b5304 --- /dev/null +++ b/t/06includepath.t @@ -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 index 0000000..0d8756d --- /dev/null +++ b/t/lib/TestApp/View/TT/Includepath.pm @@ -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 index 0000000..4a0a2d8 --- /dev/null +++ b/t/lib/TestApp/root/test_include_path/testpath.tt @@ -0,0 +1 @@ +[% message %]