fix test warning
[gitmo/Moose.git] / t / 020_attributes / 005_attribute_does.t
index 01145f8..945717b 100644 (file)
@@ -3,11 +3,10 @@
 use strict;
 use warnings;
 
-use Test::More tests => 9;
+use Test::More;
 use Test::Exception;
 
 
-
 {
     package Foo::Role;
     use Moose::Role;
@@ -19,9 +18,14 @@ use Test::Exception;
     has 'bar' => (is => 'rw', does => 'Bar::Role');
     has 'baz' => (
         is   => 'rw',
-        does => subtype('Role', where { $_->does('Bar::Role') })
+        does => role_type('Bar::Role')
     );
 
+    package Foo::Class;
+    use Moose;
+
+    with 'Foo::Role';
+
     package Bar::Role;
     use Moose::Role;
 
@@ -30,16 +34,10 @@ use Test::Exception;
     # since the isa() check will imply the does() check
     has 'foo' => (is => 'rw', isa => 'Foo::Class', does => 'Foo::Role');
 
-    package Foo::Class;
-    use Moose;
-
-    with 'Foo::Role';
-
     package Bar::Class;
     use Moose;
 
     with 'Bar::Role';
-
 }
 
 my $foo = Foo::Class->new;
@@ -100,5 +98,4 @@ lives_ok {
     } '... cannot have a isa() which is cannot does()';
 }
 
-
-
+done_testing;