File: evil_stash.t

package info (click to toggle)
libcatalyst-perl 5.90132-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,016 kB
  • sloc: perl: 11,061; makefile: 7
file content (37 lines) | stat: -rw-r--r-- 718 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use warnings;
use strict;
use Test::More;

{
  package MyApp::Controller::Root;
  $INC{'MyApp/Controller/Root.pm'} = __FILE__;

  use base 'Catalyst::Controller';

  sub root :Path('') Args(0) {
    my ($self, $c) = @_;
    $c->{stash}->{foo} = 'bar';
    $c->stash(baz=>'boor');
    $c->{stash}->{baz} = $c->stash->{baz} . 2;

    Test::More::is($c->stash->{foo}, 'bar');
    Test::More::is($c->stash->{baz}, 'boor2');
    Test::More::is($c->{stash}->{foo}, 'bar');
    Test::More::is($c->{stash}->{baz}, 'boor2');

    $c->res->body('return');
  }

  package MyApp;
  use Catalyst;
  MyApp->setup;
}

use HTTP::Request::Common;
use Catalyst::Test 'MyApp';

{
   ok my $res = request POST 'root/';
}

done_testing();