fix bug where constants containing a reference weren't handled correctly
[gitmo/Role-Tiny.git] / t / role-tiny.t
index 254e62b..7bbe99c 100644 (file)
@@ -19,6 +19,9 @@ BEGIN {
 BEGIN {
   package MyClass;
 
+  use constant SIMPLE => 'simple';
+  use constant REF_CONST => [ 'ref_const' ];
+
   sub req1 { }
   sub req2 { }
   sub foo { 'class foo' }
@@ -65,8 +68,8 @@ like(try_apply_to('NoMethods'), qr/req1, req2/, 'error for both methods');
 like(try_apply_to('OneMethod'), qr/req2/, 'error for one method');
 
 is exception {
-  Role::Tiny->apply_role_to_package('MyRole', 'IntermediaryRole');
-  Role::Tiny->apply_role_to_package('IntermediaryRole', 'ExtraClass');
+  Role::Tiny->apply_role_to_package('IntermediaryRole', 'MyRole');
+  Role::Tiny->apply_role_to_package('ExtraClass', 'IntermediaryRole');
 }, undef, 'No errors applying roles';
 
 ok(ExtraClass->does('MyRole'), 'ExtraClass does MyRole');