From: Rafael Kitover Date: Wed, 10 Jun 2009 15:13:49 +0000 (-0700) Subject: have to use a real app in test due to changes in runtime COMPONENT X-Git-Tag: 0.07~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Component-ACCEPT_CONTEXT.git;a=commitdiff_plain;h=c9c41e4d0a7b646843e3a6f471c7f02c99543e4a;hp=16beaa34faea61ca82bde58b02237776ff61804d have to use a real app in test due to changes in runtime COMPONENT --- diff --git a/t/lib/TestApp/Model/Test.pm b/t/lib/TestApp/Model/Test.pm index a870eaf..7f702af 100644 --- a/t/lib/TestApp/Model/Test.pm +++ b/t/lib/TestApp/Model/Test.pm @@ -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; } diff --git a/t/mro-ok.t b/t/mro-ok.t index 724b22b..2d0a1f2 100644 --- a/t/mro-ok.t +++ b/t/mro-ok.t @@ -9,7 +9,7 @@ BEGIN { { no warnings; sub Catalyst::Controller::new { $NEW_CALLED = 1; - return shift->NEXT::new(@_); + return shift->next::method(@_); } } } diff --git a/t/preserve-object.t b/t/preserve-object.t index 92e84fe..23a174a 100644 --- a/t/preserve-object.t +++ b/t/preserve-object.t @@ -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' } }