From: Tomas Doran Date: Sat, 5 May 2012 19:29:20 +0000 (+0100) Subject: And even composing one seems to drag unwanted sugar with it X-Git-Tag: v0.091003~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=04c82717e19c8f12f2e15351bb36212a4386a52c;p=gitmo%2FMoo.git And even composing one seems to drag unwanted sugar with it --- 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/