[Catalyst-commits] r11246 - in Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib: . PluginTestApp PluginTestApp/Controller TestAppPluginWithConstructor TestAppPluginWithConstructor/Controller

yousef at dev.catalyst.perl.org yousef at dev.catalyst.perl.org
Wed Aug 26 14:33:17 GMT 2009


Author: yousef
Date: 2009-08-26 14:33:15 +0000 (Wed, 26 Aug 2009)
New Revision: 11246

Added:
   Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/PluginTestApp/
   Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/PluginTestApp/Controller/
   Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/PluginTestApp/Controller/Root.pm
   Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/TestAppPluginWithConstructor/
   Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/TestAppPluginWithConstructor/Controller/
   Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/TestAppPluginWithConstructor/Controller/Root.pm
Modified:
   Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/PluginTestApp.pm
   Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/TestAppPluginWithConstructor.pm
Log:
More actions moved to root controllers.


Added: Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/PluginTestApp/Controller/Root.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/PluginTestApp/Controller/Root.pm	                        (rev 0)
+++ Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/PluginTestApp/Controller/Root.pm	2009-08-26 14:33:15 UTC (rev 11246)
@@ -0,0 +1,55 @@
+package PluginTestApp::Controller::Root;
+use Test::More;
+
+use base 'Catalyst::Controller';
+
+#use Catalyst qw(
+#        Test::Plugin
+#        +TestApp::Plugin::FullyQualified
+#        );
+
+__PACKAGE__->config->{namespace} = '';
+
+sub compile_time_plugins : Local {
+    my ( $self, $c ) = @_;
+
+    isa_ok $c, 'Catalyst::Plugin::Test::Plugin';
+    isa_ok $c, 'TestApp::Plugin::FullyQualified';
+
+    can_ok $c, 'registered_plugins';
+    $c->_test_plugins;
+
+    $c->res->body("ok");
+}
+
+sub run_time_plugins : Local {
+    my ( $self, $c ) = @_;
+
+    $c->_test_plugins;
+    my $faux_plugin = 'Faux::Plugin';
+
+# Trick perl into thinking the plugin is already loaded
+    $INC{'Faux/Plugin.pm'} = 1;
+
+    __PACKAGE__->plugin( faux => $faux_plugin );
+
+    isa_ok $c, 'Catalyst::Plugin::Test::Plugin';
+    isa_ok $c, 'TestApp::Plugin::FullyQualified';
+    ok !$c->isa($faux_plugin),
+    '... and it should not inherit from the instant plugin';
+    can_ok $c, 'faux';
+    is $c->faux->count, 1, '... and it should behave correctly';
+    is_deeply [ $c->registered_plugins ],
+    [
+        qw/Catalyst::Plugin::Test::Plugin
+        Faux::Plugin
+        TestApp::Plugin::FullyQualified/
+        ],
+    'registered_plugins() should report all plugins';
+    ok $c->registered_plugins('Faux::Plugin'),
+    '... and even the specific instant plugin';
+
+    $c->res->body("ok");
+}
+
+1;

Modified: Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/PluginTestApp.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/PluginTestApp.pm	2009-08-26 13:15:50 UTC (rev 11245)
+++ Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/PluginTestApp.pm	2009-08-26 14:33:15 UTC (rev 11246)
@@ -6,48 +6,6 @@
         +TestApp::Plugin::FullyQualified
         );
 
-sub compile_time_plugins : Local {
-    my ( $self, $c ) = @_;
-
-    isa_ok $c, 'Catalyst::Plugin::Test::Plugin';
-    isa_ok $c, 'TestApp::Plugin::FullyQualified';
-
-    can_ok $c, 'registered_plugins';
-    $c->_test_plugins;
-
-    $c->res->body("ok");
-}
-
-sub run_time_plugins : Local {
-    my ( $self, $c ) = @_;
-
-    $c->_test_plugins;
-    my $faux_plugin = 'Faux::Plugin';
-
-# Trick perl into thinking the plugin is already loaded
-    $INC{'Faux/Plugin.pm'} = 1;
-
-    __PACKAGE__->plugin( faux => $faux_plugin );
-
-    isa_ok $c, 'Catalyst::Plugin::Test::Plugin';
-    isa_ok $c, 'TestApp::Plugin::FullyQualified';
-    ok !$c->isa($faux_plugin),
-    '... and it should not inherit from the instant plugin';
-    can_ok $c, 'faux';
-    is $c->faux->count, 1, '... and it should behave correctly';
-    is_deeply [ $c->registered_plugins ],
-    [
-        qw/Catalyst::Plugin::Test::Plugin
-        Faux::Plugin
-        TestApp::Plugin::FullyQualified/
-        ],
-    'registered_plugins() should report all plugins';
-    ok $c->registered_plugins('Faux::Plugin'),
-    '... and even the specific instant plugin';
-
-    $c->res->body("ok");
-}
-
 sub _test_plugins {
     my $c = shift;
     is_deeply [ $c->registered_plugins ],

Added: Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/TestAppPluginWithConstructor/Controller/Root.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/TestAppPluginWithConstructor/Controller/Root.pm	                        (rev 0)
+++ Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/TestAppPluginWithConstructor/Controller/Root.pm	2009-08-26 14:33:15 UTC (rev 11246)
@@ -0,0 +1,12 @@
+package TestAppPluginWithConstructor::Controller::Root;
+
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+sub foo : Local {
+    my ($self, $c) = @_;
+    $c->res->body('foo');
+}
+
+1;

Modified: Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/TestAppPluginWithConstructor.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/TestAppPluginWithConstructor.pm	2009-08-26 13:15:50 UTC (rev 11245)
+++ Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/TestAppPluginWithConstructor.pm	2009-08-26 14:33:15 UTC (rev 11246)
@@ -6,11 +6,6 @@
 use Moose;
 BEGIN { extends qw/Catalyst Catalyst::Controller/ } # Ewww, FIXME.
 
-sub foo : Local {
-    my ($self, $c) = @_;
-    $c->res->body('foo');
-}
-
 __PACKAGE__->setup;
 our $MODIFIER_FIRED = 0;
 




More information about the Catalyst-commits mailing list