removed plack.request keys
[catagits/Catalyst-Runtime.git] / t / lib / TestFromPSGI / Controller / Root.pm
CommitLineData
4491e0cc 1package TestFromPSGI::Controller::Root;
952ff530 2
3use Moose;
4use MooseX::MethodAttributes;
5
6extends 'Catalyst::Controller';
7
f152ae23 8sub test_psgi_keys :Local {
9 my ($self, $c) = @_;
10 $c->res->body('ok');
4491e0cc 11}
12
13sub from_psgi_array : Local {
14 my ($self, $c) = @_;
15 my $res = sub {
16 my ($env) = @_;
17 return [200, ['Content-Type'=>'text/plain'],
18 [qw/hello world today/]];
19 }->($c->req->env);
20
21 $c->res->from_psgi_response($res);
22}
23
24sub from_psgi_code : Local {
25 my ($self, $c) = @_;
26
27 my $res = sub {
28 my ($env) = @_;
29 return sub {
30 my $responder = shift;
31 return $responder->([200, ['Content-Type'=>'text/plain'],
32 [qw/hello world today2/]]);
33 };
34 }->($c->req->env);
35
36 $c->res->from_psgi_response($res);
37}
38
39sub from_psgi_code_itr : Local {
40 my ($self, $c) = @_;
41 my $res = sub {
42 my ($env) = @_;
43 return sub {
44 my $responder = shift;
45 my $writer = $responder->([200, ['Content-Type'=>'text/plain']]);
46 $writer->write('hello');
47 $writer->write('world');
48 $writer->write('today3');
49 $writer->close;
50 };
51 }->($c->req->env);
52
53 $c->res->from_psgi_response($res);
952ff530 54}
55
56__PACKAGE__->meta->make_immutable;