Package Info

perl-Test-Spelling


Check for spelling errors in POD files


Development/Libraries/Perl

Test::Spelling lets you check the spelling of a 'POD' file, and report its results in standard Test::More fashion. This module requires a spellcheck program such as at http://hunspell.github.io/, aspell, spell, or, ispell. We suggest using Hunspell.

use Test::Spelling;
pod_file_spelling_ok('lib/Foo/Bar.pm', 'POD file spelling OK');

Note that it is a bad idea to run spelling tests during an ordinary CPAN distribution install, or in a package that will run in an uncontrolled environment. There is no way of predicting whether the word list or spellcheck program used will give the same results. You can include the test in your distribution, but be sure to run it only for authors of the module by guarding it in a 'skip_all unless $ENV{AUTHOR_TESTING}' clause, or by putting the test in your distribution's xt/author directory. Anyway, people installing your module really do not need to run such tests, as it is unlikely that the documentation will acquire typos while in transit.

You can add your own stop words, which are words that should be ignored by the spell check, like so:

add_stopwords(qw(asdf thiswordiscorrect));

Adding stop words in this fashion affects all files checked for the remainder of the test script. See Pod::Spell (which this module is built upon) for a variety of ways to add per-file stop words to each .pm file.

If you have a lot of stop words, it's useful to put them in your test file's 'DATA' section like so:

use strict;
use warnings;
use Test::More;

use Test::Spelling;
use Pod::Wordlist;

add_stopwords(<DATA>);
all_pod_files_spelling_ok();

__DATA__
folksonomy
Jifty
Zakirov

To maintain backwards compatibility, comment markers and some whitespace are ignored. In the near future, the preprocessing we do on the arguments to Test::Spelling/"add_stopwords" will be changed and documented properly.


License: Artistic-1.0 OR GPL-1.0-or-later
URL: https://metacpan.org/release/Test-Spelling

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.25-bp155.2.8 info GA Release 2023-05-17 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-Spelling
0.25-bp154.1.14 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-Spelling
0.20-bp153.1.12 info GA Release 2021-03-06 15 SP3
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-Spelling
0.20-bp152.3.13 info GA Release 2020-04-17 15 SP2
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-Spelling
0.20-bp151.3.1 info GA Release 2019-07-17 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-Spelling
0.20-bp151.2.10 info GA Release 2019-05-18 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-Spelling
0.20-bp150.2.4 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Test-Spelling