use Test::More;
-use Moose;
+use Moose ();
+use Moose::Util qw( apply_all_roles );
{
package MyRole;
no_leaks_ok(
sub {
+ Moose::Meta::Role->create( 'MyRole2', roles => ['MyRole'] );
+ },
+ 'named role with roles is leak-free'
+);
+
+no_leaks_ok(
+ sub {
+ my $object = Moose::Meta::Class->create('MyClass2')->new_object;
+ apply_all_roles( $object, 'MyRole' );
+ },
+ 'applying role to an instance is leak-free'
+);
+
+no_leaks_ok(
+ sub {
Moose::Meta::Role->create_anon_role;
},
'anonymous role is leak-free'