centreon-plugins/.github/scripts/pod_spell_check.t
omercier fe90a52295
new(tests): initiated unit tests (#5138)
Co-authored-by: May <110405507+mushroomempires@users.noreply.github.com>
Co-authored-by: Paul Oureib <poureib@centreon.com>

REFS: CTOR-805
2024-08-16 09:34:33 +02:00

24 lines
512 B
Perl

use strict;
use warnings;
use Test::More;
use Test::Spelling;
if (!@ARGV) {
die "Usage: perl pod_spell_check.t module.pm stopwords.t";
}
my $stopword_filename='tests/resources/spellcheck/stopwords.txt';
if(defined($ARGV[1])){
$stopword_filename=$ARGV[1];
}
open(FILE, "<", $stopword_filename)
or die "Could not open $stopword_filename";
printf("Using dictionary: ".$stopword_filename." \n");
add_stopwords(<FILE>);
close(FILE);
set_spell_cmd('hunspell -l');
all_pod_files_spelling_ok($ARGV[0]);