[Catalyst-commits] r8141 - Catalyst-Runtime/5.70/trunk/t

bricas at dev.catalyst.perl.org bricas at dev.catalyst.perl.org
Fri Jul 18 14:20:03 BST 2008


Author: bricas
Date: 2008-07-18 14:20:02 +0100 (Fri, 18 Jul 2008)
New Revision: 8141

Modified:
   Catalyst-Runtime/5.70/trunk/t/unit_core_mvc.t
Log:
add a test for ACCEPT_CONTEXT from regex fallback in view()

Modified: Catalyst-Runtime/5.70/trunk/t/unit_core_mvc.t
===================================================================
--- Catalyst-Runtime/5.70/trunk/t/unit_core_mvc.t	2008-07-18 12:29:44 UTC (rev 8140)
+++ Catalyst-Runtime/5.70/trunk/t/unit_core_mvc.t	2008-07-18 13:20:02 UTC (rev 8141)
@@ -1,4 +1,4 @@
-use Test::More tests => 43;
+use Test::More tests => 44;
 use strict;
 use warnings;
 
@@ -147,14 +147,20 @@
 }
 
 #checking @args passed to ACCEPT_CONTEXT
-my $args;
 {
+    my $args;
+
     no warnings; 
     *MyApp::Model::M::ACCEPT_CONTEXT = sub { my ($self, $c, @args) = @_; $args= \@args};
     *MyApp::View::V::ACCEPT_CONTEXT = sub { my ($self, $c, @args) = @_; $args= \@args};
-} 
-MyApp->model('M', qw/foo bar/);
-is_deeply($args, [qw/foo bar/], '$c->model args passed to ACCEPT_CONTEXT ok');
-MyApp->view('V', qw/baz moo/);
-is_deeply($args, [qw/baz moo/], '$c->view args passed to ACCEPT_CONTEXT ok');
 
+    MyApp->model('M', qw/foo bar/);
+    is_deeply($args, [qw/foo bar/], '$c->model args passed to ACCEPT_CONTEXT ok');
+
+    my $x = MyApp->view('V', qw/foo2 bar2/);
+    is_deeply($args, [qw/foo2 bar2/], '$c->view args passed to ACCEPT_CONTEXT ok');
+
+    # regexp fallback
+    MyApp->view('::View::V', qw/foo3 bar3/);
+    is_deeply($args, [qw/foo3 bar3/], 'args passed to ACCEPT_CONTEXT ok');
+}




More information about the Catalyst-commits mailing list