my $has_moose = eval { require Moose::Util };
+Sub::Defer::undefer_all();
+
# can't use Class::Inspector for the mundane parts as it does not
# distinguish imports from anything else, what a crock of...
# Moose is not always available either - hence just do it ourselves
last;
}
}
- fail ("${mod}::${name} appears to have entered inheritance chain by import into "
- . ($via || 'UNKNOWN')
- );
+
+ # exception time
+ if (
+ ( $name eq 'import' and $via = 'Exporter' )
+ ) {
+ pass("${mod}::${name} is a valid uncleaned import from ${name}");
+ }
+ else {
+ fail ("${mod}::${name} appears to have entered inheritance chain by import into "
+ . ($via || 'UNKNOWN')
+ );
+ }
}
}
sub find_modules {
my @modules;
- find({
+ find( {
wanted => sub {
-f $_ or return;
s/\.pm$// or return;
push @modules, join ('::', File::Spec->splitdir($_));
},
no_chdir => 1,
- }, (-e 'blib' ? 'blib' : 'lib') );
+ }, (
+ # find them in both lib and blib, duplicates are fine, since
+ # @INC is preadjusted for us by the harness
+ 'lib',
+ ( -e 'blib' ? 'blib' : () ),
+ ));
return sort @modules;
}