Force no_defer on DBIC-internal quote_sub() invocations
[dbsrgits/DBIx-Class.git] / xt / extra / internals / namespaces_cleaned.t
index 01650d5..e5d74ac 100644 (file)
@@ -35,13 +35,35 @@ BEGIN {
 use strict;
 use warnings;
 
+# FIXME This is a crock of shit, needs to go away
+# currently here to work around https://rt.cpan.org/Ticket/Display.html?id=74151
+# kill with fire when PS::XS / RT#74151 is *finally* fixed
+BEGIN {
+  my $PS_provider;
+
+  if ( "$]" < 5.010 ) {
+    require Package::Stash::PP;
+    $PS_provider = 'Package::Stash::PP';
+  }
+  else {
+    require Package::Stash;
+    $PS_provider = 'Package::Stash';
+  }
+  eval <<"EOS" or die $@;
+
+sub stash_for (\$) {
+  $PS_provider->new(\$_[0]);
+}
+1;
+EOS
+}
+
 use Test::More;
 
 use DBICTest;
 use File::Find;
 use File::Spec;
 use B qw/svref_2object/;
-use Package::Stash;
 
 # makes sure we can load at least something
 use DBIx::Class;
@@ -87,8 +109,6 @@ my $skip_idx = { map { $_ => 1 } (
 
 my $has_moose = eval { require Moose::Util };
 
-Sub::Defer::undefer_all();
-
 my $seen; #inheritance means we will see the same method multiple times
 
 for my $mod (@modules) {
@@ -96,7 +116,7 @@ for my $mod (@modules) {
     skip "$mod exempt from namespace checks",1 if $skip_idx->{$mod};
 
     my %all_method_like = (map
-      { %{Package::Stash->new($_)->get_all_symbols('CODE')} }
+      { %{stash_for($_)->get_all_symbols('CODE')} }
       (reverse @{mro::get_linear_isa($mod)})
     );
 
@@ -186,6 +206,7 @@ sub find_modules {
   find( {
     wanted => sub {
       -f $_ or return;
+      $_ =~ m|lib/DBIx/Class/_TempExtlib| and return;
       s/\.pm$// or return;
       s/^ (?: lib | blib . (?:lib|arch) ) . //x;
       push @modules, join ('::', File::Spec->splitdir($_));