2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
12 my $test1 = Mouse::Meta::Class->create_anon_class;
13 $test1->add_method( 'foo1', sub { } );
15 my $t1 = $test1->new_object;
16 my $t1_am = $t1->meta->get_method('foo1')->associated_metaclass;
18 ok( $t1_am, 'associated_metaclass is defined' );
21 $t1_am, 'Mouse::Meta::Class',
22 'associated_metaclass is correct class'
25 like( $t1_am->name(), qr/::__ANON__::/,
26 'associated_metaclass->name looks like an anonymous class' );
37 my $t2_am = $t2->meta->get_method('foo2')->associated_metaclass;
39 ok( $t2_am, 'associated_metaclass is defined' );
42 $t2_am, 'Mouse::Meta::Class',
43 'associated_metaclass is correct class'
46 is( $t2_am->name(), 'Test2',
47 'associated_metaclass->name is Test2' );