X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestApp%2FController%2FMoose.pm;h=d80102ea9722ae17baf474ce4b410226963b922f;hb=46c30d96cff719b2c10445b73b256e615a138773;hp=578368601617ba8f48d57fc1eb9f743e6faac28d;hpb=f04fdedae056296d0fa97fbdcaa85b9811ca6a5b;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestApp/Controller/Moose.pm b/t/lib/TestApp/Controller/Moose.pm index 5783686..d80102e 100644 --- a/t/lib/TestApp/Controller/Moose.pm +++ b/t/lib/TestApp/Controller/Moose.pm @@ -2,40 +2,18 @@ package TestApp::Controller::Moose; use Moose; +use namespace::clean -except => 'meta'; + BEGIN { extends qw/Catalyst::Controller/; } -has attribute => ( # Test defaults work +has attribute => ( is => 'ro', default => 42, ); -has other_attribute => ( # Test BUILD method is called - is => 'rw' -); - -has punctuation => ( # Test BUILD method gets merged config - is => 'rw' -); - -has space => ( # Test that attribute slots get filled from merged config - is => 'ro' -); - -no Moose; - -__PACKAGE__->config(the_punctuation => ':'); -__PACKAGE__->config(space => ' '); # i am pbp, icm5ukp - -sub BUILD { - my ($self, $config) = @_; - # Note, not an example of something you would ever - $self->other_attribute('the meaning of life'); - $self->punctuation( $config->{the_punctuation} ); -} - -sub the_answer : Local { +sub get_attribute : Local { my ($self, $c) = @_; - $c->response->body($self->other_attribute . $self->punctuation . $self->space . $self->attribute); + $c->response->body($self->attribute); } 1;