Apocalypse/Pod_Spelling.pm

filter: Statementstmt 64.8% 24 / 37 Branchbran 16.6% 1 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 8 / 10 Podpod 0.0% 0 / 1 totaltotal 61.1% 33 / 54 CC 6 SCAR 23.9
CC
6
Cov
58%
do_test
30.0
_is_disabled
2.3
_do_automated
2.0
CRAP 10.9
« Apocalypse/PerlMetrics.pm ↑ Summary Apocalypse/AutoLoader.pm »
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 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
10 package Test::Apocalypse::Pod_Spelling;
11 38 $Test::Apocalypse::Pod_Spelling::VERSION = '1.006';
12 38 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
13 38 $Test::Apocalypse::Pod_Spelling::AUTHORITY = 'cpan:APOCAL';
14 }
15  
16 # ABSTRACT: Plugin for Test::Spelling
17  
18 38 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 38 ▶use Test::Spelling 0.11;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 38 ▶use File::Spec 3.31;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 38 ▶use File::Which 1.09;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 # Spelling test almost always FAILs even with stopwords added to it...
24 0 ▶sub _do_automated { 0 }
Subroutine _do_automated: not called CC=1 SCAR=6.9
25 37 ▶sub _is_disabled {
Subroutine _is_disabled: called CC=2 SCAR=8.4
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 my $binary = which( 'spell' );
29 37 ▶ if ( ! defined $binary ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $binary) { } 37 0 37
30 37 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 0 ▶sub do_test {
Subroutine do_test: not called CC=5 SCAR=34.0
Pod undocumented
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 ▶ next if ! length $word;
Branch: 1 branch
BranchTrueFalseTotal
unless length $word 0 0 0
43 0 ▶ if ( $word =~ /^(.+)\.\w+$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($word =~ /^(.+)\.\w+$/) { } 0 0 0
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";
54 0 all_pod_files_spelling_ok();
55 }
56  
57 0 return;
58 }
59  
60 38 1;
61  
62 __END__
« Apocalypse/PerlMetrics.pm ↑ Summary Apocalypse/AutoLoader.pm »