[Catalyst-commits] r8723 - in Catalyst-Runtime/5.80/trunk: . t
t/lib t/lib/Catalyst/Action t/lib/Catalyst/Plugin/Test
t/lib/TestApp/Action
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Fri Dec 5 00:55:26 GMT 2008
Author: t0m
Date: 2008-12-05 00:55:26 +0000 (Fri, 05 Dec 2008)
New Revision: 8723
Modified:
Catalyst-Runtime/5.80/trunk/Changes
Catalyst-Runtime/5.80/trunk/Makefile.PL
Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Action/TestAfter.pm
Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Action/TestBefore.pm
Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Plugin/Test/Errors.pm
Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Plugin/Test/Headers.pm
Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Plugin/Test/Plugin.pm
Catalyst-Runtime/5.80/trunk/t/lib/TestApp.pm
Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Action/TestBefore.pm
Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Action/TestMyAction.pm
Catalyst-Runtime/5.80/trunk/t/unit_core_component_loading.t
Log:
Remove use of NEXT from the test suite, except for one (commented) case to test back compat
Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes 2008-12-05 00:00:27 UTC (rev 8722)
+++ Catalyst-Runtime/5.80/trunk/Changes 2008-12-05 00:55:26 UTC (rev 8723)
@@ -1,6 +1,8 @@
# This file documents the revision history for Perl extension Catalyst.
5.8000_04
+ - Remove use of NEXT from the test suite, except for one case
+ which tests if Class::C3::Adopt::NEXT is working (t0m)
- Use a predicate to avoid recursion in cases where the uri
method is overridden by a plugin, and calls the base method,
for example Catalyst::Plugin::SmartURI (t0m)
Modified: Catalyst-Runtime/5.80/trunk/Makefile.PL
===================================================================
--- Catalyst-Runtime/5.80/trunk/Makefile.PL 2008-12-05 00:00:27 UTC (rev 8722)
+++ Catalyst-Runtime/5.80/trunk/Makefile.PL 2008-12-05 00:55:26 UTC (rev 8723)
@@ -33,7 +33,6 @@
requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness
requires 'MRO::Compat';
-test_requires 'NEXT';
test_requires 'Class::Data::Inheritable';
if ( ( exists $ENV{AGGREGATE_TESTS} && !$ENV{AGGREGATE_TESTS})
Modified: Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Action/TestAfter.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Action/TestAfter.pm 2008-12-05 00:00:27 UTC (rev 8722)
+++ Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Action/TestAfter.pm 2008-12-05 00:55:26 UTC (rev 8723)
@@ -8,7 +8,7 @@
sub execute {
my $self = shift;
my ( $controller, $c ) = @_;
- $self->NEXT::execute( @_ );
+ $self->next::method( @_ );
$c->res->header( 'X-Action-After', $c->stash->{after_message} );
}
Modified: Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Action/TestBefore.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Action/TestBefore.pm 2008-12-05 00:00:27 UTC (rev 8722)
+++ Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Action/TestBefore.pm 2008-12-05 00:55:26 UTC (rev 8723)
@@ -9,7 +9,7 @@
my $self = shift;
my ( $controller, $c ) = @_;
$c->stash->{test} = 'works';
- $self->NEXT::execute( @_ );
+ $self->next::method( @_ );
}
1;
Modified: Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Plugin/Test/Errors.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Plugin/Test/Errors.pm 2008-12-05 00:00:27 UTC (rev 8722)
+++ Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Plugin/Test/Errors.pm 2008-12-05 00:55:26 UTC (rev 8723)
@@ -1,13 +1,13 @@
package Catalyst::Plugin::Test::Errors;
use strict;
-use NEXT;
+use Class::C3;
sub error {
my $c = shift;
unless ( $_[0] ) {
- return $c->NEXT::error(@_);
+ return $c->next::method(@_);
}
if ( $_[0] =~ /^(Unknown resource|No default action defined)/ ) {
@@ -27,7 +27,7 @@
$c->response->headers->push_header( 'X-Catalyst-Error' => $error );
- $c->NEXT::error(@_);
+ $c->next::method(@_);
}
1;
Modified: Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Plugin/Test/Headers.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Plugin/Test/Headers.pm 2008-12-05 00:00:27 UTC (rev 8722)
+++ Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Plugin/Test/Headers.pm 2008-12-05 00:55:26 UTC (rev 8723)
@@ -1,12 +1,12 @@
package Catalyst::Plugin::Test::Headers;
use strict;
-use NEXT;
+use Class::C3;
sub prepare {
my $class = shift;
- my $c = $class->NEXT::prepare(@_);
+ my $c = $class->next::method(@_);
$c->response->header( 'X-Catalyst-Engine' => $c->engine );
$c->response->header( 'X-Catalyst-Debug' => $c->debug ? 1 : 0 );
@@ -27,7 +27,7 @@
sub prepare_action {
my $c = shift;
- $c->NEXT::prepare_action(@_);
+ $c->next::method(@_);
$c->res->header( 'X-Catalyst-Action' => $c->req->action );
}
Modified: Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Plugin/Test/Plugin.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Plugin/Test/Plugin.pm 2008-12-05 00:00:27 UTC (rev 8722)
+++ Catalyst-Runtime/5.80/trunk/t/lib/Catalyst/Plugin/Test/Plugin.pm 2008-12-05 00:55:26 UTC (rev 8723)
@@ -1,7 +1,6 @@
package Catalyst::Plugin::Test::Plugin;
use strict;
-use NEXT;
use base qw/Catalyst::Base Class::Data::Inheritable/;
@@ -16,6 +15,9 @@
my $class = shift;
+# Note: This use of NEXT is deliberately left here to ensure back
+# compat, as NEXT always used to be loaded, but is now replaced
+# by Class::C3::Adopt::NEXT.
my $c = $class->NEXT::prepare(@_);
$c->response->header( 'X-Catalyst-Plugin-Setup' => $c->ran_setup );
Modified: Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Action/TestBefore.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Action/TestBefore.pm 2008-12-05 00:00:27 UTC (rev 8722)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Action/TestBefore.pm 2008-12-05 00:55:26 UTC (rev 8723)
@@ -9,7 +9,7 @@
my $self = shift;
my ( $controller, $c, $test ) = @_;
$c->res->header( 'X-TestAppActionTestBefore', $test );
- $self->NEXT::execute( @_ );
+ $self->next::method( @_ );
}
1;
Modified: Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Action/TestMyAction.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Action/TestMyAction.pm 2008-12-05 00:00:27 UTC (rev 8722)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Action/TestMyAction.pm 2008-12-05 00:55:26 UTC (rev 8723)
@@ -9,7 +9,7 @@
my $self = shift;
my ( $controller, $c, $test ) = @_;
$c->res->header( 'X-TestAppActionTestMyAction', 'MyAction works' );
- $self->NEXT::execute(@_);
+ $self->next::method(@_);
}
1;
Modified: Catalyst-Runtime/5.80/trunk/t/lib/TestApp.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp.pm 2008-12-05 00:00:27 UTC (rev 8722)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp.pm 2008-12-05 00:55:26 UTC (rev 8723)
@@ -61,7 +61,7 @@
sub finalize_error {
my $c = shift;
- $c->NEXT::finalize_error(@_);
+ $c->next::method(@_);
$c->res->status(500);
$c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
Modified: Catalyst-Runtime/5.80/trunk/t/unit_core_component_loading.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/unit_core_component_loading.t 2008-12-05 00:00:27 UTC (rev 8722)
+++ Catalyst-Runtime/5.80/trunk/t/unit_core_component_loading.t 2008-12-05 00:55:26 UTC (rev 8723)
@@ -63,10 +63,10 @@
write_component_file(\@dir_list, $name_final, <<EOF);
package $fullname;
-use NEXT;
+use Class::C3;
use base '$compbase';
sub COMPONENT {
- my \$self = shift->NEXT::COMPONENT(\@_);
+ my \$self = shift->next::method(\@_);
no strict 'refs';
*{\__PACKAGE__ . "::whoami"} = sub { return \__PACKAGE__; };
\$self;
@@ -166,7 +166,7 @@
use base 'Catalyst::Model';
sub COMPONENT {
- my \$self = shift->NEXT::COMPONENT(\@_);
+ my \$self = shift->next::method(\@_);
no strict 'refs';
*{\__PACKAGE__ . "::whoami"} = sub { return \__PACKAGE__; };
\$self;
@@ -185,7 +185,7 @@
use base 'Catalyst::Model';
no warnings 'redefine';
-sub COMPONENT { return shift->NEXT::COMPONENT(\@_); }
+sub COMPONENT { return shift->next::method(\@_); }
1;
EOF
More information about the Catalyst-commits
mailing list