line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# This file is part of Test-Apocalypse |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# This software is copyright (c) 2014 by Apocalypse. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under |
7
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself. |
8
|
|
|
|
|
|
|
# |
9
|
39
|
|
|
39
|
|
10116324
|
use strict; use warnings; |
|
39
|
|
|
39
|
|
121
|
|
|
39
|
|
|
|
|
1285
|
|
|
39
|
|
|
|
|
203
|
|
|
39
|
|
|
|
|
40
|
|
|
39
|
|
|
|
|
2063
|
|
10
|
|
|
|
|
|
|
package Test::Apocalypse::Pod_Spelling; |
11
|
|
|
|
|
|
|
$Test::Apocalypse::Pod_Spelling::VERSION = '1.003'; |
12
|
|
|
|
|
|
|
BEGIN { |
13
|
39
|
|
|
39
|
|
525
|
$Test::Apocalypse::Pod_Spelling::AUTHORITY = 'cpan:APOCAL'; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# ABSTRACT: Plugin for Test::Spelling |
17
|
|
|
|
|
|
|
|
18
|
39
|
|
|
39
|
|
158
|
use Test::More; |
|
39
|
|
|
|
|
230
|
|
|
39
|
|
|
|
|
350
|
|
19
|
39
|
|
|
39
|
|
27198
|
use Test::Spelling 0.11; |
|
39
|
|
|
|
|
622542
|
|
|
39
|
|
|
|
|
2698
|
|
20
|
39
|
|
|
39
|
|
198
|
use File::Spec 3.31; |
|
39
|
|
|
|
|
468
|
|
|
39
|
|
|
|
|
196
|
|
21
|
39
|
|
|
39
|
|
784
|
use File::Which 1.09; |
|
39
|
|
|
|
|
584
|
|
|
39
|
|
|
|
|
7494
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# TODO because spelling test almost always FAILs even with stopwords added to it... |
24
|
0
|
|
|
0
|
|
0
|
sub _do_automated { 0 } |
25
|
38
|
|
|
38
|
|
304
|
sub _is_disabled { 1 } |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub do_test { |
28
|
|
|
|
|
|
|
# Thanks to CPANTESTERS, not everyone have "spell" installed... |
29
|
|
|
|
|
|
|
# FIXME pester Test::Spelling author to be more smarter about this failure mode! |
30
|
0
|
|
|
0
|
0
|
|
my $binary = which( 'spell' ); |
31
|
0
|
0
|
|
|
|
|
if ( ! defined $binary ) { |
32
|
0
|
|
|
|
|
|
plan skip_all => 'The binary "spell" is not found, unable to test spelling!'; |
33
|
0
|
|
|
|
|
|
return; |
34
|
|
|
|
|
|
|
} else { |
35
|
|
|
|
|
|
|
# Set the spell path, to be sure! |
36
|
0
|
|
|
|
|
|
set_spell_cmd( $binary ); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# get our list of files, and add the "namespaces" as stopwords |
40
|
0
|
|
|
|
|
|
foreach my $p ( Test::Spelling::all_pod_files() ) { |
41
|
0
|
|
|
|
|
|
foreach my $word ( File::Spec->splitdir( $p ) ) { |
42
|
0
|
0
|
|
|
|
|
next if ! length $word; |
43
|
0
|
0
|
|
|
|
|
if ( $word =~ /^(.+)\.\w+$/ ) { |
44
|
0
|
|
|
|
|
|
add_stopwords( $1 ); |
45
|
|
|
|
|
|
|
} else { |
46
|
0
|
|
|
|
|
|
add_stopwords( $word ); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
# Run the test! |
52
|
|
|
|
|
|
|
TODO: { |
53
|
0
|
|
|
|
|
|
local $TODO = "Pod_Spelling"; |
|
0
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
all_pod_files_spelling_ok(); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
return; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
__END__ |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=pod |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=encoding UTF-8 |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=for :stopwords Apocalypse Niebur Ryan spellchecker stopword stopwords pm |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=for Pod::Coverage do_test |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 NAME |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Test::Apocalypse::Pod_Spelling - Plugin for Test::Spelling |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 VERSION |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This document describes v1.003 of Test::Apocalypse::Pod_Spelling - released October 24, 2014 as part of Test-Apocalypse. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 DESCRIPTION |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Encapsulates L<Test::Spelling> functionality. We also add each filename as a stopword, to reduce "noise" from the spellchecker. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
If you need to add stopwords, please look at L<Pod::Spell> for ways to add it to each .pm file! |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 SEE ALSO |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Please see those modules/websites for more information related to this module. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=over 4 |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=item * |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
L<Test::Apocalypse|Test::Apocalypse> |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=back |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 AUTHOR |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Apocalypse <APOCAL@cpan.org> |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Apocalypse. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
107
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
The full text of the license can be found in the |
110
|
|
|
|
|
|
|
F<LICENSE> file included with this distribution. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTY |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY |
115
|
|
|
|
|
|
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT |
116
|
|
|
|
|
|
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY |
117
|
|
|
|
|
|
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, |
118
|
|
|
|
|
|
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
119
|
|
|
|
|
|
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM |
120
|
|
|
|
|
|
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF |
121
|
|
|
|
|
|
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
124
|
|
|
|
|
|
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS |
125
|
|
|
|
|
|
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY |
126
|
|
|
|
|
|
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE |
127
|
|
|
|
|
|
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF |
128
|
|
|
|
|
|
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD |
129
|
|
|
|
|
|
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), |
130
|
|
|
|
|
|
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
131
|
|
|
|
|
|
|
SUCH DAMAGES. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=cut |