6 package MyAppChild::Controller::User;
7 $INC{'MyAppChild/Controller/User.pm'} = __FILE__;
9 use base 'Catalyst::Controller';
14 $c->stash->{inner} = "inner";
15 $c->res->body( "inner: ${\$c->stash->{inner}}, outer: ${\$c->stash->{outer}}");
17 is_deeply [sort {$a cmp $b} keys(%{$c->stash})], ['inner','outer'], 'both keys in stash';
21 $INC{'MyAppChild.pm'} = __FILE__;
26 package MyAppParent::Controller::User;
27 $INC{'MyAppParent/Controller/User.pm'} = __FILE__;
29 use base 'Catalyst::Controller';
34 $c->stash->{outer} = "outer";
35 $c->res->from_psgi_response( MyAppChild->to_app->($c->req->env) );
37 is_deeply [keys(%{$c->stash})], ['outer'], 'only one key in stash';
47 use Catalyst::Test 'MyAppParent';
49 my $res = request '/user/stash';
50 is $res->content, 'inner: inner, outer: outer', 'got expected response';