X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=t%2F001_mouse%2F070-inherit-role-attr.t;fp=t%2F001_mouse%2F070-inherit-role-attr.t;h=ba46a3f6d47f733b287f36dc7ea059e8c5216b99;hp=0000000000000000000000000000000000000000;hb=0d8640df33c576d6d331c5ae0106a11805372552;hpb=6f09819f35c5d66d8de41a6d8aa1cd1395815397 diff --git a/t/001_mouse/070-inherit-role-attr.t b/t/001_mouse/070-inherit-role-attr.t new file mode 100644 index 0000000..ba46a3f --- /dev/null +++ b/t/001_mouse/070-inherit-role-attr.t @@ -0,0 +1,31 @@ +#!perl -w +use strict; +use Test::More; +{ + package Role; + use Mouse::Role; + + has foo => ( + is => 'bare', + init_arg => undef, + ); + + package Class; + use Mouse; + with 'Role'; + + has "+foo" => ( + default => 'bar', + ); + + ::ok( __PACKAGE__->meta->find_attribute_by_name('foo')->has_default ); +} + +my $foo = Class->meta->get_attribute('foo'); +ok $foo; +is $foo->name, 'foo'; +is $foo->init_arg, undef; +is $foo->default, 'bar'; + +done_testing; +