Test::CleanNamespaces(3pm)

Test::CleanNamespaces3pm

Check for uncleaned imports

Usage

    use strict;
    use warnings;
    use Test::CleanNamespaces;
    all_namespaces_clean;

Version

version 0.24

Overview

This module lets you check your module's namespaces for imported functions you might have forgotten to remove with namespace::autoclean or namespace::clean and are therefore available to be called as methods, which usually isn't want you want.

Functions

All functions are exported by default.

namespaces_clean

    namespaces_clean('YourModule', 'AnotherModule');

Tests every specified namespace for uncleaned imports. If the module couldn't be loaded it will be skipped.

all_namespaces_clean

    all_namespaces_clean;

Runs "namespaces_clean" for all modules in your distribution.

find_modules

    my @modules = Test::CleanNamespaces->find_modules;

Returns a list of modules in the current distribution. It'll search in "blib/", if it exists. "lib/" will be searched otherwise.

builder

    my $builder = Test::CleanNamespaces->builder;

Returns the "Test::Builder" used by the test functions.

Known issues

Uncleaned imports from Mouse classes are incompletely detected, due to its lack of ability to return the correct method list -- it assumes that all subs are meant to be callable as methods unless they originated from (were imported by) one of: Mouse, Mouse::Role, Mouse::Util, Mouse::Util::TypeConstraints, Carp, Scalar::Util, or List::Util.

Support

Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Test-CleanNamespaces> (or [email protected] <mailto:[email protected]>).

There is also a mailing list available for users of this distribution, at <http://lists.perl.org/list/perl-qa.html>.

There is also an irc channel available for users of this distribution, at "#perl" on "irc.perl.org" <irc://irc.perl.org/#perl-qa>.

Contributors

•

Karen Etheridge <[email protected]>

•

Graham Knop <[email protected]>

Releases

6 releases since Debian 8 (Jessie); the text changed 2 times.

  1. 8
  2. 9
  3. 10–13

Author

Florian Ragwitz <[email protected]>

From libtest-cleannamespaces-perl 0.24-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.