X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xt%2Fmoose-override-attribute-with-plus-syntax.t;h=0a9570f5864ed7d2c2e340429a9828e76ce7345b;hb=dcc862ca7849e996583c57c479d831f8eb1e7fd8;hp=fb3c31e83be0e8dc4c4440a6fb05e0d03905b3a7;hpb=6e77b8df0c2c56f2b38212072011147950558848;p=gitmo%2FMoo.git diff --git a/xt/moose-override-attribute-with-plus-syntax.t b/xt/moose-override-attribute-with-plus-syntax.t index fb3c31e..0a9570f 100644 --- a/xt/moose-override-attribute-with-plus-syntax.t +++ b/xt/moose-override-attribute-with-plus-syntax.t @@ -31,6 +31,15 @@ use Test::Fatal; ); __PACKAGE__->meta->make_immutable } +{ + package MooChild; + use Moo; + extends 'MooParent'; + + has '+foo' => ( + default => sub { 'MooChild' }, + ); +} is( MooseChild->new->foo, @@ -44,5 +53,10 @@ is( 'default value in Moose child' ); +is(exception { + local $SIG{__WARN__} = sub { die $_[0] }; + ok(MooChild->meta->has_attribute('foo'), 'inflated metaclass has overridden attribute'); +}, undef, 'metaclass inflation of plus override works without warnings'); + done_testing;