X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F55namespaces_cleaned.t;h=30795a77d1995f61e5d7b6f6c9be6ebaf1d2fc2c;hb=1b5ddf236a7911b6686be06602ffd657372523c2;hp=c8a2f75141ee31fd0f6b0f0f5d4e37ef02dab918;hpb=9345b14c6c86aa8888bf5d47a569ee9bbde24f47;p=dbsrgits%2FDBIx-Class.git diff --git a/t/55namespaces_cleaned.t b/t/55namespaces_cleaned.t index c8a2f75..30795a7 100644 --- a/t/55namespaces_cleaned.t +++ b/t/55namespaces_cleaned.t @@ -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 { @@ -77,8 +80,8 @@ my $skip_idx = { map { $_ => 1 } ( # from the parent 'DBIx::Class::ResultSet::Pager', - # Moo does not name its generated methods, fix pending - 'DBIx::Class::Storage::BlockRunner', + # a utility class, not part of the inheritance chain + 'DBIx::Class::ResultSource::RowParser::Util', ) }; my $has_cmop = eval { require Class::MOP }; @@ -109,7 +112,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 +120,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 +150,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/) {