[Catalyst-commits] r9161 - in trunk/Catalyst-Log-Log4perl: . t/lib

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Mon Feb 2 13:28:12 GMT 2009


Author: t0m
Date: 2009-02-02 13:28:12 +0000 (Mon, 02 Feb 2009)
New Revision: 9161

Modified:
   trunk/Catalyst-Log-Log4perl/Makefile.PL
   trunk/Catalyst-Log-Log4perl/t/lib/MockApp.pm
Log:
Apply rafl's patch to fix the horrible hack in the test suite which breaks C3

Modified: trunk/Catalyst-Log-Log4perl/Makefile.PL
===================================================================
--- trunk/Catalyst-Log-Log4perl/Makefile.PL	2009-02-02 13:03:37 UTC (rev 9160)
+++ trunk/Catalyst-Log-Log4perl/Makefile.PL	2009-02-02 13:28:12 UTC (rev 9161)
@@ -7,6 +7,7 @@
 requires( 'Params::Validate' => 0 );
 requires( 'Sub::Install'     => 0 );
 requires( 'Data::Dump' => 0 );
+requires( 'MRO::Compat' => 0 );
 
 auto_include;
 auto_install;

Modified: trunk/Catalyst-Log-Log4perl/t/lib/MockApp.pm
===================================================================
--- trunk/Catalyst-Log-Log4perl/t/lib/MockApp.pm	2009-02-02 13:03:37 UTC (rev 9160)
+++ trunk/Catalyst-Log-Log4perl/t/lib/MockApp.pm	2009-02-02 13:28:12 UTC (rev 9161)
@@ -8,6 +8,7 @@
 use base qw/Class::Accessor::Fast/;
 __PACKAGE__->mk_ro_accessors('context');
 
+use MRO::Compat;
 use Catalyst;
 use Catalyst::Log::Log4perl;
 use Catalyst::Runtime;
@@ -25,26 +26,12 @@
 log4perl.appender.LOG.layout.ConversionPattern=[%c] %m
 CONF
 
-sub new {
-    my $class = shift;
-    my $self  = $class->NEXT::new(@_);
+sub finalize {
+    my $c = shift;
+    $c->next::method(@_);
+    return $c;
+};
 
-    my $finalize = \&Catalyst::finalize;
-    Sub::Install::reinstall_sub(
-        {
-            code => sub {
-                my $c = shift;
-                $self->{context} = $c;
-                $finalize->($c);
-            },
-            into => qw/Catalyst/,
-            as   => 'finalize',
-        }
-    );
-
-    return $self;
-}
-
 sub setup {
     my $class = shift;
     my $res   = $class->NEXT::setup(@_);
@@ -87,8 +74,7 @@
         SERVER_PORT     => 3000,
         SERVER_PROTOCOL => "HTTP/1.0",
     );
-    $self->handle_request;
-    return $self->context;
+    return $self->handle_request;
 }
 
 1;




More information about the Catalyst-commits mailing list