7 use Moose::Meta::Class;
8 use Moose::Util::MetaRole;
23 my $anon_class = Moose::Meta::Class->create_anon_class(
24 superclasses => ['Foo'],
28 $anon_name = $anon_class->name;
30 ok( $anon_name->meta, 'anon class has a metaclass' );
35 'cached anon class still has a metaclass after \$anon_class goes out of scope'
38 Moose::Util::MetaRole::apply_metaroles(
41 class => ['Role::Bar'],
45 BAIL_OUT('Cannot continue if the anon class does not have a metaclass')
46 unless $anon_name->can('meta');
48 my $meta = $anon_name->meta;
49 ok( $meta, 'cached anon class still has a metaclass applying a metarole' );