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;
10 $TODO = q{Mouse is not yet completed};
13 use Mouse::Meta::Role::Application;
14 use Mouse::Meta::Role::Composite;
20 before foo => sub { 'Role::Foo::foo' };
21 around foo => sub { 'Role::Foo::foo' };
22 after foo => sub { 'Role::Foo::foo' };
23 around baz => sub { [ 'Role::Foo', @{shift->(@_)} ] };
28 before bar => sub { 'Role::Bar::bar' };
29 around bar => sub { 'Role::Bar::bar' };
30 after bar => sub { 'Role::Bar::bar' };
36 around baz => sub { [ 'Role::Baz', @{shift->(@_)} ] };
41 package Class::FooBar;
45 sub foo { 'placeholder' }
46 sub baz { ['Class::FooBar'] }
49 #test modifier call order
53 ['Role::Baz','Role::Foo','Class::FooBar']
57 # test simple overrides
59 my $c = Mouse::Meta::Role::Composite->new(
65 isa_ok($c, 'Mouse::Meta::Role::Composite');
67 is($c->name, 'Role::Foo|Role::Bar', '... got the composite role name');
70 Mouse::Meta::Role::Application->new->apply($c);
71 } '... this succeeds as expected';
74 [ sort $c->get_method_modifier_list('before') ],
76 '... got the right list of methods'
80 [ sort $c->get_method_modifier_list('after') ],
82 '... got the right list of methods'
86 [ sort $c->get_method_modifier_list('around') ],
87 [ 'bar', 'baz', 'foo' ],
88 '... got the right list of methods'