X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestApp%2FController%2FMoose.pm;h=705b2bd9bccf892650c701d36091d7344370376c;hb=8484866421e8caa420e118848629c3b62d6086c3;hp=d80102ea9722ae17baf474ce4b410226963b922f;hpb=2167982fde3685f83594211f034e89f2fd67e336;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestApp/Controller/Moose.pm b/t/lib/TestApp/Controller/Moose.pm index d80102e..705b2bd 100644 --- a/t/lib/TestApp/Controller/Moose.pm +++ b/t/lib/TestApp/Controller/Moose.pm @@ -5,6 +5,10 @@ use Moose; use namespace::clean -except => 'meta'; BEGIN { extends qw/Catalyst::Controller/; } +use MooseX::MethodAttributes; # FIXME - You need to say this if you have + # modifiers so that you get the correct + # method metaclass, why does the modifier + # on MODIFY_CODE_ATTRIBUTES not work. has attribute => ( is => 'ro', @@ -16,4 +20,14 @@ sub get_attribute : Local { $c->response->body($self->attribute); } +sub with_local_modifier : Local { + my ($self, $c) = @_; + $c->forward('get_attribute'); +} + +before with_local_modifier => sub { + my ($self, $c) = @_; + $c->response->header( 'X-Catalyst-Test-Before' => 'before called' ); +}; + 1;