5 package One; use Role::Tiny;
6 around foo => sub { my $orig = shift; (__PACKAGE__, $orig->(@_)) };
7 package Two; use Role::Tiny;
8 around foo => sub { my $orig = shift; (__PACKAGE__, $orig->(@_)) };
9 package Three; use Role::Tiny;
10 around foo => sub { my $orig = shift; (__PACKAGE__, $orig->(@_)) };
11 package Four; use Role::Tiny;
12 around foo => sub { my $orig = shift; (__PACKAGE__, $orig->(@_)) };
13 package Base; sub foo { __PACKAGE__ }
17 [ qw(One Two Three Four) ],
18 [ qw(Two Four Three) ],
21 my $combined = Role::Tiny->create_class_with_roles('Base', @$combo);
23 [ $combined->foo ], [ reverse(@$combo), 'Base' ],
26 my $object = bless({}, 'Base');
27 Role::Tiny->apply_roles_to_object($object, @$combo);
28 is(ref($object), $combined, 'Object reblessed into correct class');