Skip to content

Commit

Permalink
Start to use Test::DescribeMe
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Oct 21, 2024
1 parent b63aede commit a0b4dcc
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 45 deletions.
15 changes: 5 additions & 10 deletions t/comment-spelling.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
use 5.006;
use strict;
use warnings;

use Test::DescribeMe qw(author);
use Test::Most;
use Test::Needs { 'Test::Spelling::Comment' => '0.002' };

if($ENV{AUTHOR_TESTING} ) {
eval 'use Test::Spelling::Comment 0.002';
if($@) {
plan(skip_all => 'Test::Spelling::Comment required for testing comment spelling');
} else {
Test::Spelling::Comment->new()->add_stopwords(<DATA>)->all_files_ok();
}
} else {
plan(skip_all => 'Author tests not required for installation');
}
Test::Spelling::Comment->import();
Test::Spelling::Comment->new()->add_stopwords(<DATA>)->all_files_ok();

__DATA__
cgi
Expand Down
22 changes: 5 additions & 17 deletions t/coverage.t
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
use strict;
use warnings;
use Test::DescribeMe qw(author);
use Test::Most;
use Test::Needs { 'Test::Pod::Coverage' => '1.08', 'Pod::Coverage' => 0.18 };

if($ENV{'AUTHOR_TESTING'}) {
# Ensure a recent version of Test::Pod::Coverage
my $min_tpc = 1.08;
eval "use Test::Pod::Coverage $min_tpc";
plan(skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage")
if $@;
Test::Pod::Coverage->import();
Pod::Coverage->import();

# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
# but older versions don't recognize some common documentation styles
my $min_pc = 0.18;
eval "use Pod::Coverage $min_pc";
plan(skip_all => "Pod::Coverage $min_pc required for testing POD coverage")
if $@;

all_pod_coverage_ok();
} else {
plan(skip_all => 'Author tests not required for installation');
}
all_pod_coverage_ok();
3 changes: 2 additions & 1 deletion t/eof.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

use strict;
use warnings;

use Test::DescribeMe qw(author);
use Test::Needs 'Test::EOF';
use Test::Most;
use Test::Needs 'Test::EOF';

Test::EOF->import();
all_perl_files_ok({ minimum_newlines => 1, maximum_newlines => 4 });
Expand Down
3 changes: 2 additions & 1 deletion t/eol.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

use strict;
use warnings;

use Test::DescribeMe qw(author);
use Test::Needs 'Test::EOL';
use Test::Most;
use Test::Needs 'Test::EOL';

Test::EOL->import();
all_perl_files_ok({ trailing_whitespace => 1 });
15 changes: 5 additions & 10 deletions t/links.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@

use strict;
use warnings;

use Test::DescribeMe qw(author);
use Test::Most;
use Test::Needs 'Test::Pod::LinkCheck';

if($ENV{AUTHOR_TESTING}) {
eval 'use Test::Pod::LinkCheck';
if($@) {
plan(skip_all => 'Test::Pod::LinkCheck required for testing POD');
} else {
Test::Pod::LinkCheck->new->all_pod_ok();
}
} else {
plan(skip_all => 'Author tests not required for installation');
}
Test::Pod::LinkCheck->import();
Test::Pod::LinkCheck->new->all_pod_ok();
10 changes: 4 additions & 6 deletions t/pod-synopsis.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

use strict;
use warnings;

use Test::DescribeMe qw(author);
use Test::Most;
use Test::Needs 'Test::Synopsis';

if($ENV{AUTHOR_TESTING}) {
Test::Synopsis->import();
all_synopsis_ok();
} else {
plan(skip_all => 'Author tests not required for installation');
}
Test::Synopsis->import();
all_synopsis_ok();

0 comments on commit a0b4dcc

Please sign in to comment.