[Catalyst-commits] r11247 - in
Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t:
. lib lib/ACLTestApp lib/ACLTestApp/Controller
lib/PluginTestApp/Controller
yousef at dev.catalyst.perl.org
yousef at dev.catalyst.perl.org
Wed Aug 26 15:38:04 GMT 2009
Author: yousef
Date: 2009-08-26 15:38:02 +0000 (Wed, 26 Aug 2009)
New Revision: 11247
Added:
Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/ACLTestApp.pm
Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/ACLTestApp/
Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/ACLTestApp/Controller/
Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/ACLTestApp/Controller/Root.pm
Modified:
Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/PluginTestApp/Controller/Root.pm
Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/unit_dispatcher_requestargs_restore.t
Log:
Moved ACLTestApp from the test file to an app class and a root controller.
Added: Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/ACLTestApp/Controller/Root.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/ACLTestApp/Controller/Root.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/ACLTestApp/Controller/Root.pm 2009-08-26 15:38:02 UTC (rev 11247)
@@ -0,0 +1,17 @@
+package ACLTestApp::Controller::Root;
+
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+sub foobar : Private {
+ die $Catalyst::DETACH;
+}
+
+sub gorch : Local {
+ my ( $self, $c, $frozjob ) = @_;
+ is $frozjob, 'wozzle';
+ $c->res->body("gorch");
+}
+
+1;
Added: Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/ACLTestApp.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/ACLTestApp.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/ACLTestApp.pm 2009-08-26 15:38:02 UTC (rev 11247)
@@ -0,0 +1,26 @@
+package ACLTestApp;
+use Test::More;
+
+use strict;
+use warnings;
+use MRO::Compat;
+use Scalar::Util ();
+
+use base qw/Catalyst Catalyst::Controller/;
+use Catalyst qw//;
+
+sub execute {
+ my $c = shift;
+ my ( $class, $action ) = @_;
+
+ if ( Scalar::Util::blessed($action)
+ and $action->name ne "foobar" ) {
+ eval { $c->detach( 'foobar', [$action, 'foo'] ) };
+ }
+
+ $c->next::method( @_ );
+}
+
+__PACKAGE__->setup;
+
+1;
Modified: 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 2009-08-26 14:33:15 UTC (rev 11246)
+++ Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/lib/PluginTestApp/Controller/Root.pm 2009-08-26 15:38:02 UTC (rev 11247)
@@ -31,7 +31,7 @@
# Trick perl into thinking the plugin is already loaded
$INC{'Faux/Plugin.pm'} = 1;
- __PACKAGE__->plugin( faux => $faux_plugin );
+ ref($c)->plugin( faux => $faux_plugin );
isa_ok $c, 'Catalyst::Plugin::Test::Plugin';
isa_ok $c, 'TestApp::Plugin::FullyQualified';
Modified: Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/unit_dispatcher_requestargs_restore.t
===================================================================
--- Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/unit_dispatcher_requestargs_restore.t 2009-08-26 14:33:15 UTC (rev 11246)
+++ Catalyst-Runtime/5.80/branches/deprecate_appclass_actions/t/unit_dispatcher_requestargs_restore.t 2009-08-26 15:38:02 UTC (rev 11247)
@@ -10,43 +10,7 @@
# executing another action from the dispatcher (i.e. wrapping actions)
# is present, so that the Authorization::ACL plugin can be re-written
# to not be full of such crazy shit.
-{
- package ACLTestApp;
- use Test::More;
- use strict;
- use warnings;
- use MRO::Compat;
- use Scalar::Util ();
-
- use base qw/Catalyst Catalyst::Controller/;
- use Catalyst qw//;
-
- sub execute {
- my $c = shift;
- my ( $class, $action ) = @_;
-
- if ( Scalar::Util::blessed($action)
- and $action->name ne "foobar" ) {
- eval { $c->detach( 'foobar', [$action, 'foo'] ) };
- }
-
- $c->next::method( @_ );
- }
-
- sub foobar : Private {
- die $Catalyst::DETACH;
- }
-
- sub gorch : Local {
- my ( $self, $c, $frozjob ) = @_;
- is $frozjob, 'wozzle';
- $c->res->body("gorch");
- }
-
- __PACKAGE__->setup;
-}
-
use strict;
use warnings;
use FindBin qw/$Bin/;
More information about the Catalyst-commits
mailing list