X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F55namespaces_cleaned.t;h=a8a966df73a287f4e60d2dcefad371f72bdd3eb5;hb=8d73fcd44e0441f0252744be32bada6816c5ff6b;hp=176de5e79fbfdddf4fa878598f021c5d21e7967c;hpb=bfcecabc3c48500d28a9a648c8e4c8a649a63f66;p=dbsrgits%2FDBIx-Class.git diff --git a/t/55namespaces_cleaned.t b/t/55namespaces_cleaned.t index 176de5e..a8a966d 100644 --- a/t/55namespaces_cleaned.t +++ b/t/55namespaces_cleaned.t @@ -36,8 +36,14 @@ use warnings; use Test::More; use lib 't/lib'; -use DBICTest; +BEGIN { + require DBICTest::RunMode; + plan( skip_all => "Skipping test on plain module install" ) + if DBICTest::RunMode->is_plain; +} + +use DBICTest; use File::Find; use File::Spec; use B qw/svref_2object/; @@ -87,6 +93,8 @@ my $skip_idx = { map { $_ => 1 } ( 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 @@ -143,9 +151,18 @@ for my $mod (@modules) { 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') + ); + } } }