4 use ExtUtils::Manifest qw(maniread);
6 eval "use Pod::Spell 1.15";
7 plan skip_all => "Pod::Spell 1.15 required for spellchecking POD" if $@;
10 my $manifest = maniread();
11 @pod = sort grep !/^inc/ && /\.(pm|pl|pod|PL)$/, keys %$manifest;
13 plan tests => scalar(@pod);
14 my $my_stopwords = <<'WORDS';
85 # https://bugs.launchpad.net/ubuntu/+source/aspell/+bug/71322
89 my $check_fh = File::Temp->new;
90 my $check_filename = $check_fh->filename;
91 my $work_fh = File::Temp->new;
92 my $work_filename = $work_fh->filename;
93 open my $pod, "<", $file
94 or die "Cannot open $file for spell check: $!\n";
96 my $stop_re = qr/\b(xxxxx)\b/;
98 if (/^=for\s+stopwords\s+(.*)/) {
99 push @local_stop, map quotemeta, split ' ', $1;
100 my $stop_re_str = join('|', @local_stop);
101 $stop_re = qr/\b($stop_re_str)\b/;
108 seek $work_fh, 0, SEEK_SET;
109 my $spell = Pod::Spell->new;
110 $spell->stopwords->learn_stopwords($my_stopwords);
111 $spell->parse_from_filehandle($work_fh, $check_fh);
115 my @out = `aspell list <$check_filename`;
116 unless (ok(@out == 0, "spell check $file")) {
120 open my $fh, "<", $check_filename;