sub extra1 { 'role extra' }
}
+BEGIN {
+ package BrokenRole;
+ use Role::Tiny;
+
+ around 'broken modifier' => sub { my $orig = shift; $orig->(@_) };
+}
+
sub try_apply_to {
my $to = shift;
exception { Role::Tiny->apply_role_to_package($to, 'MyRole') }
isa_ok($new_class, 'MyClass');
is($new_class->extra1, 'role extra', 'method from role');
+ok(exception {
+ $new_class = Role::Tiny->create_class_with_roles('MyClass', 'BrokenRole');
+}, 'exception caught creating class with broken modifier in a role');
+
done_testing;