[Catalyst-commits] r9805 - in Catalyst-Runtime/5.80/trunk/t:
aggregate lib/TestApp/Controller lib/TestApp/Controller/Moose
abraxxa at dev.catalyst.perl.org
abraxxa at dev.catalyst.perl.org
Thu Apr 23 11:41:36 GMT 2009
Author: abraxxa
Date: 2009-04-23 12:41:36 +0100 (Thu, 23 Apr 2009)
New Revision: 9805
Added:
Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Moose/
Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Moose/MethodModifiers.pm
Modified:
Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_moose.t
Log:
added test for Moose controller inheritance using method modifiers
Modified: Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_moose.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_moose.t 2009-04-23 00:45:06 UTC (rev 9804)
+++ Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_moose.t 2009-04-23 11:41:36 UTC (rev 9805)
@@ -4,7 +4,7 @@
use FindBin;
use lib "$FindBin::Bin/../lib";
-use Test::More tests => 2;
+use Test::More tests => 4;
use Catalyst::Test 'TestApp';
{
@@ -12,3 +12,9 @@
ok($response->is_success);
is($response->content, '42', 'attribute default values get set correctly');
}
+
+{
+ my $response = request('http://localhost/moose/methodmodifiers/get_attribute');
+ ok($response->is_success);
+ is($response->header('X-Catalyst-Test-After'), 'after called', 'after works as expected');
+}
Added: Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Moose/MethodModifiers.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Moose/MethodModifiers.pm (rev 0)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Moose/MethodModifiers.pm 2009-04-23 11:41:36 UTC (rev 9805)
@@ -0,0 +1,10 @@
+package TestApp::Controller::Moose::MethodModifiers;
+use Moose;
+BEGIN { extends qw/TestApp::Controller::Moose/; }
+
+after get_attribute => sub {
+ my ($self, $c) = @_;
+ $c->response->header( 'X-Catalyst-Test-After' => 'after called' );
+};
+
+1;
More information about the Catalyst-commits
mailing list