From: Tomas Doran Date: Mon, 19 Apr 2010 01:04:53 +0000 (+0100) Subject: Add failing test from Catalyst X-Git-Tag: 1.05~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=76176929d34f942cc47a2c457650b3abfb53d9ea;p=gitmo%2FMoose.git Add failing test from Catalyst This happens when you use Catalyst (which causes you to inherit from Catalyst::Controller with is a MX::MethodAttributes metaclass) and you have attributes which geenrate methods your application class, and an (old style, M::I) Plugin in the plugin list, which is only pushed onto @ISA when the setup method is later called.. --- diff --git a/t/050_metaclasses/052_metaclass_compat.t b/t/050_metaclasses/052_metaclass_compat.t index dc9e4db..c2b8ab4 100644 --- a/t/050_metaclasses/052_metaclass_compat.t +++ b/t/050_metaclasses/052_metaclass_compat.t @@ -210,4 +210,35 @@ ok(Foo::Sub->meta->constructor_class->meta->can('does_role') ::lives_ok { $meta->make_immutable } "can still make immutable"; } +{ + package Foo5::Meta::Role; + use Moose::Role; +} +{ + package Foo5::SuperClass::WithMetaRole; + use Moose -traits =>'Foo5::Meta::Role'; +} +{ + package Foo5::SuperClass::After::Attribute; + use Moose; +} +{ + package Foo5; + use Moose; + my @superclasses = ('Foo5::SuperClass::WithMetaRole'); + extends @superclasses; + + has an_attribute_generating_methods => ( is => 'ro' ); + + push(@superclasses, 'Foo5::SuperClass::After::Attribute'); + + ::lives_ok { + extends @superclasses; + } 'MI extends after_generated_methods with metaclass roles'; + ::lives_ok { + extends reverse @superclasses; + } + 'MI extends after_generated_methods with metaclass roles (reverse)'; +} + done_testing;