Somewhat, but not much more sane. There are still bugs here, but this _should_ fix...
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Moose.pm
1 package TestApp::Controller::Moose;
2
3 use Moose;
4
5 use namespace::clean -except => 'meta';
6
7 BEGIN { extends qw/Catalyst::Controller/; }
8 use 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.
12
13 has attribute => (
14     is      => 'ro',
15     default => 42,
16 );
17
18 sub get_attribute : Local {
19     my ($self, $c) = @_;
20     $c->response->body($self->attribute);
21 }
22
23 before get_attribute => sub {
24     my ($self, $c) = @_;
25     $c->response->header( 'X-Catalyst-Test-Before' => 'before called' );
26 };
27
28 1;