[Catalyst-commits] r7013 - in trunk/Catalyst-View-Mason/t: . lib
lib/TestApp/View/Mason
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Tue Oct 16 11:17:28 GMT 2007
Author: rafl
Date: 2007-10-16 11:17:28 +0100 (Tue, 16 Oct 2007)
New Revision: 7013
Added:
trunk/Catalyst-View-Mason/t/comp_path.t
trunk/Catalyst-View-Mason/t/lib/TestApp/View/Mason/Comppath.pm
Modified:
trunk/Catalyst-View-Mason/t/lib/TestApp.pm
Log:
Test get_component_path.
Added: trunk/Catalyst-View-Mason/t/comp_path.t
===================================================================
--- trunk/Catalyst-View-Mason/t/comp_path.t (rev 0)
+++ trunk/Catalyst-View-Mason/t/comp_path.t 2007-10-16 10:17:28 UTC (rev 7013)
@@ -0,0 +1,14 @@
+#!perl
+
+use strict;
+use warnings;
+use Test::More tests => 3;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use_ok('Catalyst::Test', 'TestApp');
+
+my $request = request('/comp_path?view=Comppath');
+ok($request->is_success, 'request ok');
+is($request->content, "param: bar\n", 'used /foo component');
Added: trunk/Catalyst-View-Mason/t/lib/TestApp/View/Mason/Comppath.pm
===================================================================
--- trunk/Catalyst-View-Mason/t/lib/TestApp/View/Mason/Comppath.pm (rev 0)
+++ trunk/Catalyst-View-Mason/t/lib/TestApp/View/Mason/Comppath.pm 2007-10-16 10:17:28 UTC (rev 7013)
@@ -0,0 +1,13 @@
+package TestApp::View::Mason::Comppath;
+
+use strict;
+use warnings;
+use base qw/Catalyst::View::Mason/;
+
+__PACKAGE__->config(use_match => 0);
+
+sub get_component_path {
+ return '/foo';
+}
+
+1;
Modified: trunk/Catalyst-View-Mason/t/lib/TestApp.pm
===================================================================
--- trunk/Catalyst-View-Mason/t/lib/TestApp.pm 2007-10-16 10:17:15 UTC (rev 7012)
+++ trunk/Catalyst-View-Mason/t/lib/TestApp.pm 2007-10-16 10:17:28 UTC (rev 7013)
@@ -88,6 +88,12 @@
sub additional_globals : Local {
}
+sub comp_path : Local {
+ my ($self, $c) = @_;
+
+ $c->stash->{param} = 'bar';
+}
+
sub end : Private {
my ($self, $c) = @_;
More information about the Catalyst-commits
mailing list