File Coverage

blib/lib/Test/Apocalypse/Pod_Spelling.pm
Criterion Covered Total %
statement 22 35 62.8
branch 1 6 16.6
condition n/a
subroutine 8 10 80.0
pod 0 1 0.0
total 31 52 59.6


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 38     38   8182995 use strict; use warnings;
  38     38   84  
  38         1256  
  38         192  
  38         41  
  38         1956  
10             package Test::Apocalypse::Pod_Spelling;
11             $Test::Apocalypse::Pod_Spelling::VERSION = '1.004';
12             BEGIN {
13 38     38   496 $Test::Apocalypse::Pod_Spelling::AUTHORITY = 'cpan:APOCAL';
14             }
15              
16             # ABSTRACT: Plugin for Test::Spelling
17              
18 38     38   193 use Test::More;
  38         79  
  38         308  
19 38     38   29696 use Test::Spelling 0.11;
  38         582329  
  38         3000  
20 38     38   267 use File::Spec 3.31;
  38         531  
  38         190  
21 38     38   836 use File::Which 1.09;
  38         495  
  38         7049  
22              
23             # Spelling test almost always FAILs even with stopwords added to it...
24 0     0   0 sub _do_automated { 0 }
25             sub _is_disabled {
26             # Thanks to CPANTESTERS, not everyone have "spell" installed...
27             # FIXME pester Test::Spelling author to be more smarter about this failure mode!
28 37     37   222 my $binary = which( 'spell' );
29 37 50       5069 if ( ! defined $binary ) {
30 37         111 return 'The binary "spell" is not found, unable to test spelling!';
31             } else {
32             # Set the spell path, to be sure!
33 0           set_spell_cmd( $binary );
34 0           return;
35             }
36             }
37              
38             sub do_test {
39             # get our list of files, and add the "namespaces" as stopwords
40 0     0 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.004 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