have to use a real app in test due to changes in runtime COMPONENT
[catagits/Catalyst-Component-ACCEPT_CONTEXT.git] / t / preserve-object.t
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' }
 }