with 'Foo::Role', 'Bar::Role';
}
+{
+ package Baz::Role;
+ use Moose::Role;
+ with 'Foo::Role';
+}
+
+{
+ package Baz;
+ use Moose;
+
+ with 'Baz::Role';
+}
+
+{
+ package Quux;
+ use Moose;
+
+ with 'Foo::Role';
+ with 'Bar::Role';
+}
+
with_immutable {
my $foo;
is(exception { $foo = Foo->new(foo => undef) }, undef,
is(exception { $bar = Bar->new(foo => undef) }, undef,
"can set to undef in constructor");
ok(!$bar->has_foo, "role attribute isn't set");
-} 'Foo', 'Bar';
+
+ my $baz;
+ is(exception { $baz = Baz->new(foo => undef) }, undef,
+ "can set to undef in constructor");
+ ok(!$baz->has_foo, "role attribute isn't set");
+
+ my $quux;
+ is(exception { $quux = Quux->new(foo => undef) }, undef,
+ "can set to undef in constructor");
+ ok(!$quux->has_foo, "role attribute isn't set");
+} 'Foo', 'Bar', 'Baz', 'Quux';
done_testing;