| 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
| |||||||||||
| 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
| |||||||||||
| 43 | 0 | ▶ | if ( $word =~ /^(.+)\.\w+$/ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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__ | ||||||||||