NAME
Perl::Critic::Policy::TestingAndDebugging::RequireTestLabels
DESCRIPTION
Most Perl modules with regression tests use Test::More as infrastructure for writing and running those tests. It has an easy, procedural syntax for writing comparisons of results to expectations.
Most of the Test::More functions allow the programmer to add an optional label that describes what each test is trying to judge. When a test goes wrong, these labels are very useful for quickly determining where the problem originated.
This policy enforces that all Test::More functions have labels where applicable. This only applies to code that has a use Test::More
or require Test::More
declaration (see below to add more test modules to the list).
CONSTRUCTOR
This policy accepts an additional key-value pair in the new
method. The key should be 'modules' and the value is a string of space-delimited fully qualified module names. These can be configured in the .perlcriticrc file like this:
[TestingAndDebugging::RequireTestLabels]
modules = My::Test::SubClass Some::Other::Module
The module list always implicitly includes Test::More.
AUTHOR
Chris Dolan <cdolan@cpan.org>
COPYRIGHT
Copyright (C) 2006 Chris Dolan. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.