2 use warnings FATAL => 'all';
6 plan skip_all => "Class::Method::Modifiers not installed or too old"
7 unless eval "use Class::Method::Modifiers 1.05; 1";
11 package One; use Role::Tiny;
12 around foo => sub { my $orig = shift; (__PACKAGE__, $orig->(@_)) };
13 package Two; use Role::Tiny;
14 around foo => sub { my $orig = shift; (__PACKAGE__, $orig->(@_)) };
15 package Three; use Role::Tiny;
16 around foo => sub { my $orig = shift; (__PACKAGE__, $orig->(@_)) };
17 package Four; use Role::Tiny;
18 around foo => sub { my $orig = shift; (__PACKAGE__, $orig->(@_)) };
19 package Base; sub foo { __PACKAGE__ }
23 [ qw(One Two Three Four) ],
24 [ qw(Two Four Three) ],
27 my $combined = Role::Tiny->create_class_with_roles('Base', @$combo);
29 [ $combined->foo ], [ reverse(@$combo), 'Base' ],
32 my $object = bless({}, 'Base');
33 Role::Tiny->apply_roles_to_object($object, @$combo);
34 is(ref($object), $combined, 'Object reblessed into correct class');