stop using Moo as a test package
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Moose.pm
index d80102e..705b2bd 100644 (file)
@@ -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;