[Catalyst-commits] r13519 - in
Catalyst-View-TT/branches/export_methods/t: .
lib/TestApp/View/TT lib/TestApp/root
lukes at dev.catalyst.perl.org
lukes at dev.catalyst.perl.org
Tue Aug 24 18:19:43 GMT 2010
Author: lukes
Date: 2010-08-24 19:19:43 +0100 (Tue, 24 Aug 2010)
New Revision: 13519
Added:
Catalyst-View-TT/branches/export_methods/t/12expose_methods.t
Catalyst-View-TT/branches/export_methods/t/lib/TestApp/View/TT/ExposeMethods.pm
Catalyst-View-TT/branches/export_methods/t/lib/TestApp/root/expose_methods.tt
Log:
added all the missing files
Added: Catalyst-View-TT/branches/export_methods/t/12expose_methods.t
===================================================================
--- Catalyst-View-TT/branches/export_methods/t/12expose_methods.t (rev 0)
+++ Catalyst-View-TT/branches/export_methods/t/12expose_methods.t 2010-08-24 18:19:43 UTC (rev 13519)
@@ -0,0 +1,12 @@
+use strict;
+use warnings;
+use Test::More tests => 3;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use_ok('Catalyst::Test', 'TestApp');
+
+my $response;
+ok(($response = request("/test?view=ExposeMethods&template=expose_methods.tt"))->is_success, 'request ok');
+is($response->content, "magic added param", 'message ok');
Added: Catalyst-View-TT/branches/export_methods/t/lib/TestApp/View/TT/ExposeMethods.pm
===================================================================
--- Catalyst-View-TT/branches/export_methods/t/lib/TestApp/View/TT/ExposeMethods.pm (rev 0)
+++ Catalyst-View-TT/branches/export_methods/t/lib/TestApp/View/TT/ExposeMethods.pm 2010-08-24 18:19:43 UTC (rev 13519)
@@ -0,0 +1,20 @@
+package TestApp::View::TT::ExposeMethods;
+
+use Moose;
+extends 'Catalyst::View::TT';
+
+__PACKAGE__->config(
+ expose_methods => [q/exposed_method/],
+);
+
+sub exposed_method {
+ my ($self, $c, $some_param) = @_;
+
+ unless ($some_param) {
+ Catalyst::Exception->throw( "no param passed" );
+ }
+ return 'magic ' . $some_param;
+}
+
+
+1;
Added: Catalyst-View-TT/branches/export_methods/t/lib/TestApp/root/expose_methods.tt
===================================================================
--- Catalyst-View-TT/branches/export_methods/t/lib/TestApp/root/expose_methods.tt (rev 0)
+++ Catalyst-View-TT/branches/export_methods/t/lib/TestApp/root/expose_methods.tt 2010-08-24 18:19:43 UTC (rev 13519)
@@ -0,0 +1 @@
+[% exposed_method('added param') %]
\ No newline at end of file
More information about the Catalyst-commits
mailing list