2 use warnings FATAL => 'all';
7 plan skip_all => "Class::Method::Modifiers not installed"
8 unless eval "use Class::Method::Modifiers; 1";
16 around foo => sub { my $orig = shift; join ' ', 'role foo', $orig->(@_) };
22 sub foo { 'class foo' }
29 around 'broken modifier' => sub { my $orig = shift; $orig->(@_) };
34 exception { Role::Tiny->apply_role_to_package($to, 'MyRole') }
37 is(try_apply_to('MyClass'), undef, 'role applies cleanly');
38 is(MyClass->foo, 'role foo class foo', 'method modifier');
41 my $new_class = Role::Tiny->create_class_with_roles('MyClass', 'BrokenRole');
42 }, 'exception caught creating class with broken modifier in a role');