Avoid duplication in running the same tests with and without immutable
[gitmo/Moose.git] / t / 600_todo_tests / 002_various_role_shit.t
index ea17eff..f1fbc06 100644 (file)
@@ -10,7 +10,10 @@ sub req_or_has ($$) {
     my ( $role, $method ) = @_;
     local $Test::Builder::Level = $Test::Builder::Level + 1;
     if ( $role ) {
-        ok( $role->has_method($method) || $role->requires_method($method), $role->name . " has or requires method $method" );
+        ok( 
+            $role->has_method($method) || $role->requires_method($method), 
+            $role->name . " has or requires method $method" 
+        );
     } else {
         fail("role has or requires method $method");
     }
@@ -80,7 +83,6 @@ sub req_or_has ($$) {
     has twist => ( is => "rw" );
 
     {
-        local our $TODO = "accessors don't satisfy role requires";
         ::lives_ok { with qw(Dancer) };
     }
 
@@ -199,11 +201,7 @@ ok( $gorch->has_attribute("attr"), "has attribute 'attr'" );
 req_or_has($gorch, "gorch_method");
 ok( $gorch->has_method("gorch_method"), "has_method gorch_method" );
 ok( !$gorch->requires_method("gorch_method"), "requires gorch method" );
-
-{
-    local $TODO = "role method isn't a meta object yet";
-    isa_ok( $gorch->get_method("gorch_method"), "Moose::Meta::Method" );
-}
+isa_ok( $gorch->get_method("gorch_method"), "Moose::Meta::Method" );
 
 {
     local $TODO = "method modifier doesn't yet create a method requirement or meta object";
@@ -235,8 +233,9 @@ ok( $robot->has_attribute("twist"), "has attr 'twist'" );
 }
 
 {
-    local $TODO = "attribute related methods are not yet known by the role";
     req_or_has($robot, "twist");
+
+    local $TODO = "attribute related methods are not yet known by the role";
     ok( $robot->has_method("twist"), "has twist method" );
     isa_ok( $robot->get_method("twist"), "Moose::Meta::Method" );
     isa_ok( $robot->get_method("twist"), "Moose::Meta::Method::Accessor" );