have to use a real app in test due to changes in runtime COMPONENT
Rafael Kitover [Wed, 10 Jun 2009 15:13:49 +0000 (08:13 -0700)]
t/lib/TestApp/Model/Test.pm
t/mro-ok.t
t/preserve-object.t

index a870eaf..7f702af 100644 (file)
@@ -8,7 +8,7 @@ use base qw(Catalyst::Component::ACCEPT_CONTEXT Catalyst::Model);
 my $foo = 'bar';
 sub new {
     my $self = shift;
-    $self = $self->NEXT::new(@_);
+    $self = $self->next::method(@_);
     $foo = $self->context->config->{foo};
     return $self;
 }
index 724b22b..2d0a1f2 100644 (file)
@@ -9,7 +9,7 @@ BEGIN {
     { no warnings;
       sub Catalyst::Controller::new {
           $NEW_CALLED = 1;
-          return shift->NEXT::new(@_);
+          return shift->next::method(@_);
       }
   }
 }
index 92e84fe..23a174a 100644 (file)
@@ -4,11 +4,11 @@ use strict;
 use warnings;
 use Test::More tests => 4;
 
-my $app = { app => 'oh yeah' };
+my $app = 'MyApp';
 
 my $foo = Foo->COMPONENT($app, { args => 'yes' });
 is $foo->{args}, 'yes', 'foo created';
-is $foo->context->{app}, 'oh yeah', 'got app';
+is $foo->context->app, 'oh yeah', 'got app';
 
 my $ctx = { ctx => 'it is' };
 my $foo2 = $foo->ACCEPT_CONTEXT($ctx);
@@ -21,7 +21,10 @@ is $foo->context->{ctx}, 'it is', 'got ctx';
 
     sub new {
         my $class = shift;
-        return $class->NEXT::new(@_);
+        return $class->next::method(@_);
     }
 
+    package MyApp;
+    use Catalyst;
+    sub app { 'oh yeah' }
 }