[Catalyst-commits] r13354 - in
Catalyst-Runtime/5.80/branches/rt58057: lib/Catalyst t
t/lib/TestApp/Controller/Moose
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Tue Jun 15 21:17:32 GMT 2010
Author: t0m
Date: 2010-06-15 22:17:32 +0100 (Tue, 15 Jun 2010)
New Revision: 13354
Added:
Catalyst-Runtime/5.80/branches/rt58057/t/lib/TestApp/Controller/Moose/NoAttributes.pm
Catalyst-Runtime/5.80/branches/rt58057/t/unit_core_methodattributes_method_metaclass_on_subclasses.t
Modified:
Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Controller.pm
Log:
Commit standalone test, test which makes the TestApp blow up and the nasty workaround
Modified: Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Controller.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Controller.pm 2010-06-15 21:15:31 UTC (rev 13353)
+++ Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Controller.pm 2010-06-15 21:17:32 UTC (rev 13354)
@@ -225,7 +225,7 @@
foreach my $method (@methods) {
my $name = $method->name;
- my $attributes = $method->attributes;
+ my $attributes = $method->can('attributes') ? $method->attributes : [];
my $attrs = $self->_parse_attrs( $c, $name, @{ $attributes } );
if ( $attrs->{Private} && ( keys %$attrs > 1 ) ) {
$c->log->debug( 'Bad action definition "'
Added: Catalyst-Runtime/5.80/branches/rt58057/t/lib/TestApp/Controller/Moose/NoAttributes.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/rt58057/t/lib/TestApp/Controller/Moose/NoAttributes.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/rt58057/t/lib/TestApp/Controller/Moose/NoAttributes.pm 2010-06-15 21:17:32 UTC (rev 13354)
@@ -0,0 +1,16 @@
+package TestApp::Controller::Moose::NoAttributes;
+use Moose;
+extends qw/Catalyst::Controller/;
+
+__PACKAGE__->config(
+ actions => {
+ test => { Local => undef }
+ }
+);
+
+sub test {
+}
+
+no Moose;
+1;
+
Added: Catalyst-Runtime/5.80/branches/rt58057/t/unit_core_methodattributes_method_metaclass_on_subclasses.t
===================================================================
--- Catalyst-Runtime/5.80/branches/rt58057/t/unit_core_methodattributes_method_metaclass_on_subclasses.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/rt58057/t/unit_core_methodattributes_method_metaclass_on_subclasses.t 2010-06-15 21:17:32 UTC (rev 13354)
@@ -0,0 +1,27 @@
+use strict;
+use Test::More;
+
+{
+ package NoAttributes::CT;
+ use Moose;
+ BEGIN { extends qw/Catalyst::Controller/; };
+
+ sub test {}
+}
+{
+ package NoAttributes::RT;
+ use Moose;
+ extends qw/Catalyst::Controller/;
+
+ sub test {}
+}
+
+foreach my $class (qw/ CT RT /) {
+ my $class_name = 'NoAttributes::' . $class;
+ my $meta = $class_name->meta;
+ my $meth = $meta->find_method_by_name('test');
+ ok $meth->can('attributes'), 'method metaclass has ->attributes method for ' . $class;;
+}
+
+done_testing;
+
More information about the Catalyst-commits
mailing list