[Catalyst-commits] r6757 - in trunk/Catalyst-View-Mason/t: . lib
lib/TestApp/View/Mason lib/TestApp/root lib/TestApp/root/match
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Tue Aug 28 16:58:53 GMT 2007
Author: rafl
Date: 2007-08-28 16:58:53 +0100 (Tue, 28 Aug 2007)
New Revision: 6757
Added:
trunk/Catalyst-View-Mason/t/action.t
trunk/Catalyst-View-Mason/t/lib/TestApp/View/Mason/Match.pm
trunk/Catalyst-View-Mason/t/lib/TestApp/root/action_match
trunk/Catalyst-View-Mason/t/lib/TestApp/root/match/
trunk/Catalyst-View-Mason/t/lib/TestApp/root/match/foo
trunk/Catalyst-View-Mason/t/match.t
Modified:
trunk/Catalyst-View-Mason/t/lib/TestApp.pm
Log:
Test use_match.
Added: trunk/Catalyst-View-Mason/t/action.t
===================================================================
--- trunk/Catalyst-View-Mason/t/action.t (rev 0)
+++ trunk/Catalyst-View-Mason/t/action.t 2007-08-28 15:58:53 UTC (rev 6757)
@@ -0,0 +1,13 @@
+#!perl
+
+use strict;
+use warnings;
+use Test::More tests => 2;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use_ok('Catalyst::Test', 'TestApp');
+
+my $request = request('/action_match/foo?view=Match');
+ok($request->is_success, 'request ok');
Added: trunk/Catalyst-View-Mason/t/lib/TestApp/View/Mason/Match.pm
===================================================================
--- trunk/Catalyst-View-Mason/t/lib/TestApp/View/Mason/Match.pm (rev 0)
+++ trunk/Catalyst-View-Mason/t/lib/TestApp/View/Mason/Match.pm 2007-08-28 15:58:53 UTC (rev 6757)
@@ -0,0 +1,11 @@
+package TestApp::View::Mason::Match;
+
+use strict;
+use warnings;
+use base qw/Catalyst::View::Mason/;
+
+__PACKAGE__->config(
+ use_match => 0,
+);
+
+1;
Added: trunk/Catalyst-View-Mason/t/lib/TestApp/root/action_match
===================================================================
--- trunk/Catalyst-View-Mason/t/lib/TestApp/root/action_match (rev 0)
+++ trunk/Catalyst-View-Mason/t/lib/TestApp/root/action_match 2007-08-28 15:58:53 UTC (rev 6757)
@@ -0,0 +1,4 @@
+<%args>
+$message
+</%args>
+<% $message %>\
Added: trunk/Catalyst-View-Mason/t/lib/TestApp/root/match/foo
===================================================================
--- trunk/Catalyst-View-Mason/t/lib/TestApp/root/match/foo (rev 0)
+++ trunk/Catalyst-View-Mason/t/lib/TestApp/root/match/foo 2007-08-28 15:58:53 UTC (rev 6757)
@@ -0,0 +1,4 @@
+<%args>
+$message
+</%args>
+<% $message %>\
Modified: trunk/Catalyst-View-Mason/t/lib/TestApp.pm
===================================================================
--- trunk/Catalyst-View-Mason/t/lib/TestApp.pm 2007-08-28 15:58:46 UTC (rev 6756)
+++ trunk/Catalyst-View-Mason/t/lib/TestApp.pm 2007-08-28 15:58:53 UTC (rev 6757)
@@ -47,6 +47,18 @@
}
}
+sub match : Regex('^match/(\w+)') {
+ my ($self, $c) = @_;
+
+ $c->stash->{message} = $c->request->captures->[0];
+}
+
+sub action_match : Regex('^action_match/(\w+)') {
+ my ($self, $c) = @_;
+
+ $c->stash->{message} = $c->request->captures->[0];
+}
+
sub end : Private {
my ($self, $c) = @_;
Added: trunk/Catalyst-View-Mason/t/match.t
===================================================================
--- trunk/Catalyst-View-Mason/t/match.t (rev 0)
+++ trunk/Catalyst-View-Mason/t/match.t 2007-08-28 15:58:53 UTC (rev 6757)
@@ -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 $response = request('/match/foo?view=Pkgconfig');
+ok($response->is_success, 'request ok');
+is($response->content, 'foo');
More information about the Catalyst-commits
mailing list