From: Matt S Trout Date: Thu, 15 Dec 2005 15:52:00 +0000 (+0000) Subject: - Added V::TT fix-up from zby X-Git-Tag: v0.30~40 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8d236c8c1d777b019c93726f0ad8bec000052690;p=catagits%2FCatalyst-View-TT.git - Added V::TT fix-up from zby --- diff --git a/t/06includepath.t b/t/06includepath.t index 0da5a8f..c376a8e 100644 --- a/t/06includepath.t +++ b/t/06includepath.t @@ -8,15 +8,15 @@ 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, 'additional_template_path'); -is($response->content, TestApp->config->{default_message}, 'message ok'); +ok(($response = request("/test_includepath?view=Appconfig&template=testpath.tt&additionalpath=test_include_path"))->is_success, 'additional_template_path request'); +is($response->content, TestApp->config->{default_message}, 'additional_template_path message'); -ok(($response = request("/test_includepath?view=Includepath&template=testpath.tt"))->is_success, 'scalar include path from config'); -is($response->content, TestApp->config->{default_message}, 'message ok'); +ok(($response = request("/test_includepath?view=Includepath&template=testpath.tt"))->is_success, 'scalar include path from config request'); +is($response->content, TestApp->config->{default_message}, 'scalar include path with delimiter from config message'); -ok(($response = request("/test_includepath?view=Includepath2&template=testpath.tt"))->is_success, 'object ref (that stringifys to the path) include path from config'); -is($response->content, TestApp->config->{default_message}, 'message ok'); +ok(($response = request("/test_includepath?view=Includepath2&template=testpath.tt"))->is_success, 'object ref (that stringifys to the path) include path from config request'); +is($response->content, TestApp->config->{default_message}, 'object ref (that stringifys to the path) include path from config message'); -ok(($response = request("/test_includepath?view=Includepath3&template=testpath.tt&addpath=test_include_path"))->is_success, 'array ref include path from config not replaced by another array'); -is($response->content, TestApp->config->{default_message}, 'message ok'); +ok(($response = request("/test_includepath?view=Includepath3&template=testpath.tt&addpath=test_include_path"))->is_success, 'array ref include path from config not replaced by another array request'); +is($response->content, TestApp->config->{default_message}, 'array ref include path from config not replaced by another array message'); diff --git a/t/lib/TestApp/View/TT/Includepath2.pm b/t/lib/TestApp/View/TT/Includepath2.pm new file mode 100644 index 0000000..11f2667 --- /dev/null +++ b/t/lib/TestApp/View/TT/Includepath2.pm @@ -0,0 +1,16 @@ +package TestApp::View::TT::Includepath2; + +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 => $includepath, +); + +1; diff --git a/t/lib/TestApp/View/TT/Includepath3.pm b/t/lib/TestApp/View/TT/Includepath3.pm new file mode 100644 index 0000000..ebadc34 --- /dev/null +++ b/t/lib/TestApp/View/TT/Includepath3.pm @@ -0,0 +1,17 @@ +package TestApp::View::TT::Includepath3; + +use FindBin; +use Path::Class; +use strict; +use base 'Catalyst::View::TT'; + +our @include_path; +my $includepath = dir($FindBin::Bin, '/lib/TestApp/root/test_include_path'); +__PACKAGE__->config( + PRE_CHOMP => 1, + POST_CHOMP => 1, + TEMPLATE_EXTENSION => '.tt', + INCLUDE_PATH => \@include_path, +); + +1;