Make tests local::lib compatible, remove generated files
[catagits/Catalyst-Controller-WrapCGI.git] / t / global-context.t
CommitLineData
ac41c40b 1#!perl
457c1d76 2
3use strict;
4use warnings;
5
6use Test::More tests => 1;
7
8{
9 package TestApp;
10
11 use Catalyst;
12 use CatalystX::GlobalContext ();
13
14 sub auto : Private {
15 my ($self, $c) = @_;
16 CatalystX::GlobalContext->set_context($c);
17 1;
18 }
19
20 sub dummy : Local {
21 my ($self, $c) = @_;
22 $c->res->body(Dongs->foo);
23 }
24
25 __PACKAGE__->setup;
26
27 package Dongs;
28
29 use CatalystX::GlobalContext '$c';
30
31 sub foo { $c->action }
32}
33
34use Catalyst::Test 'TestApp';
35
36is(get('/dummy'), 'dummy', 'global context works');