Test::CleanNamespaces - Check for uncleaned imports
version 0.02
use strict; use warnings; use Test::CleanNamespaces; all_namespaces_clean;
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 therefor available to be called as methods, which usually isn't want you want.
All functions are exported by default.
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;
Runs namespaces_clean for all modules in your distribution.
namespaces_clean
The exported functions are constructed using the the following methods. This is what you want to override if you're subclassing this module..
my $coderef = Test::CleanNamespaces->build_namespaces_clean;
Returns a coderef that will be exported as namespaces_clean.
Returns a coderef that will be exported as all_namespaces_clean. It will use the find_modules method to get the list of modules to check.
all_namespaces_clean
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.
blib/
lib/
my $builder = Test::CleanNamespaces->builder;
Returns the Test::Builder used by the test functions.
Test::Builder
Florian Ragwitz <rafl@debian.org>
This software is copyright (c) 2009 by Florian Ragwitz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Test::CleanNamespaces, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::CleanNamespaces
CPAN shell
perl -MCPAN -e shell install Test::CleanNamespaces
For more information on module installation, please visit the detailed CPAN module installation guide.