Restore ability to handle underdefined root (t/prefetch/incomplete.t)
[dbsrgits/DBIx-Class.git] / t / 55namespaces_cleaned.t
index c8a2f75..e87cab7 100644 (file)
@@ -35,6 +35,9 @@ use warnings;
 
 use Test::More;
 
+use lib 't/lib';
+use DBICTest;
+
 use File::Find;
 use File::Spec;
 use B qw/svref_2object/;
@@ -45,7 +48,7 @@ use DBIx::Class;
 use DBIx::Class::Carp;
 
 my @modules = grep {
-  my $mod = $_;
+  my ($mod) = $_ =~ /(.+)/;
 
   # not all modules are loadable at all times
   do {
@@ -76,9 +79,6 @@ my $skip_idx = { map { $_ => 1 } (
   # this subclass is expected to inherit whatever crap comes
   # from the parent
   'DBIx::Class::ResultSet::Pager',
-
-  # Moo does not name its generated methods, fix pending
-  'DBIx::Class::Storage::BlockRunner',
 ) };
 
 my $has_cmop = eval { require Class::MOP };
@@ -109,7 +109,7 @@ for my $mod (@modules) {
 
     for my $name (keys %all_method_like) {
 
-      next if ( DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN() and $name =~ /^carp(?:_unique|_once)?$/ );
+      next if ( DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN and $name =~ /^carp(?:_unique|_once)?$/ );
 
       # overload is a funky thing - it is not cleaned, and its imports are named funny
       next if $name =~ /^\(/;
@@ -117,17 +117,10 @@ for my $mod (@modules) {
       my $gv = svref_2object($all_method_like{$name})->GV;
       my $origin = $gv->STASH->NAME;
 
-      TODO: {
-        local $TODO;
-        if ($name =~ /^__CAG_/) {
-          $TODO = 'CAG does not clean its BEGIN constants';
-        }
-
-        is ($gv->NAME, $name, "Properly named $name method at $origin" . ($origin eq $mod
-          ? ''
-          : " (inherited by $mod)"
-        ));
-      }
+      is ($gv->NAME, $name, "Properly named $name method at $origin" . ($origin eq $mod
+        ? ''
+        : " (inherited by $mod)"
+      ));
 
       next if $seen->{"${origin}:${name}"}++;
 
@@ -154,7 +147,7 @@ for my $mod (@modules) {
       }
     }
 
-    next if DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN();
+    next if DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN;
 
     # some common import names (these should never ever be methods)
     for my $f (qw/carp carp_once carp_unique croak confess cluck try catch finally/) {