don't use $_ as loop variable when calling arbitrary code
[gitmo/Role-Tiny.git] / t / role-basic-bugs.t
index 571880f..94443de 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl
 
-use lib 'lib', 't/role-basic/lib';
+use lib 'lib', 't/role-basic/lib', 't/lib';
 use MyTests;
 
 # multiple roles with the same role
@@ -44,6 +44,9 @@ use MyTests;
     use Role::Tiny 'with';
     with 'A::NonExistent::Role';
     END
+}
+
+{
     my $error = $@ || '';
     like $error, qr{^Can't locate A/NonExistent/Role.pm},
         'If ->can always returns true, we should still not think we loaded the role'
@@ -74,4 +77,6 @@ use MyTests;
     ::ok(Role::Tiny::does_role($object, "Role1"), 'Role1 consumed');
     ::ok(Role::Tiny::does_role($object, 'Role2'), 'Role2 consumed');
 }
+
+can_ok(Role::Tiny->create_class_with_roles(qw(Bar Baz))->new, qw(bar baz));
 done_testing;