stop using Moo as a test package
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Moose.pm
CommitLineData
2167982f 1package TestApp::Controller::Moose;
2
3use Moose;
4
5use namespace::clean -except => 'meta';
6
7BEGIN { extends qw/Catalyst::Controller/; }
cf37d21a 8use MooseX::MethodAttributes; # FIXME - You need to say this if you have
9 # modifiers so that you get the correct
10 # method metaclass, why does the modifier
11 # on MODIFY_CODE_ATTRIBUTES not work.
2167982f 12
13has attribute => (
14 is => 'ro',
15 default => 42,
16);
17
18sub get_attribute : Local {
19 my ($self, $c) = @_;
20 $c->response->body($self->attribute);
21}
22
84848664 23sub with_local_modifier : Local {
24 my ($self, $c) = @_;
25 $c->forward('get_attribute');
26}
27
28before with_local_modifier => sub {
cf37d21a 29 my ($self, $c) = @_;
30 $c->response->header( 'X-Catalyst-Test-Before' => 'before called' );
31};
32
2167982f 331;