X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xt%2Fmoo-roles-into-moose-class.t;h=d1d0a6c8d974649450fe1756544c81e939fa79a9;hb=04c82717e19c8f12f2e15351bb36212a4386a52c;hp=e7ac1a005fbd0518a689679d80115197055de608;hpb=7127b94e4cae9f6aed68b7016adc7a2f88bbd9ff;p=gitmo%2FMoo.git diff --git a/xt/moo-roles-into-moose-class.t b/xt/moo-roles-into-moose-class.t index e7ac1a0..d1d0a6c 100644 --- a/xt/moo-roles-into-moose-class.t +++ b/xt/moo-roles-into-moose-class.t @@ -1,5 +1,7 @@ use strict; +use warnings; use Test::More; + { package Foo; use Moo::Role; @@ -9,8 +11,27 @@ use Test::More; package Bar; use Moo::Role; use namespace::autoclean; + + has attr => ( + is => 'ro' + ); + + sub thing {} } { + package Baz; + use Moose; + no Moose; + + ::ok(!__PACKAGE__->can('has'), 'No has function after no Moose;'); + Moose::with('Baz', 'Bar'); +} + +::is(Baz->can('thing'), Bar->can('thing'), 'Role copies method correctly'); +::ok(Baz->can('attr'), 'Attr accessor correct'); +::ok(!Baz->can('has'), 'Sugar not copied'); + +{ package Bax; use Moose; with qw/