Skip to content

Commit

Permalink
Use Test::Needs
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Mar 30, 2024
1 parent 102a8cf commit a8f9026
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 30 deletions.
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ WriteMakefile(
'LWP::Protocol::https' => 0,
'Test::Exception' => 0.42, # http://www.cpantesters.org/cpan/report/91a6ac80-6bf9-1014-b7eb-bb2be30b7e63
'Test::Most' => 0,
'Test::Needs' => 0,
'Test::NoWarnings' => 0,
'Test::URI' => 0,
'Test::Timer' => 2.01,
Expand Down
16 changes: 5 additions & 11 deletions t/eof.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@

use strict;
use warnings;
use Test::Needs 'Test::EOF';
use Test::Most;

BEGIN {
if($ENV{AUTHOR_TESTING}) {
eval {
require Test::EOF;
};
if($@) {
plan(skip_all => 'Test::EOF not installed');
} else {
import Test::EOF;
all_perl_files_ok({ minimum_newlines => 1, maximum_newlines => 4 });
done_testing();
}
if($ENV{'AUTHOR_TESTING'}) {
Test::EOF->import();
all_perl_files_ok({ minimum_newlines => 1, maximum_newlines => 4 });
done_testing();
} else {
plan(skip_all => 'Author tests not required for installation');
}
Expand Down
17 changes: 6 additions & 11 deletions t/eol.t
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
#!/usr/bin/env perl

use strict;
use warnings;

use Test::Needs 'Test::EOL';
use Test::Most;

BEGIN {
if($ENV{AUTHOR_TESTING}) {
eval {
require Test::EOL;
};
if($@) {
plan(skip_all => 'Test::EOL not installed');
} else {
import Test::EOL;
all_perl_files_ok({ trailing_whitespace => 1 });
}
if($ENV{'AUTHOR_TESTING'}) {
Test::EOL->import();
all_perl_files_ok({ trailing_whitespace => 1 });
} else {
plan(skip_all => 'Author tests not required for installation');
}
Expand Down
16 changes: 8 additions & 8 deletions t/links.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ use strict;
use warnings;
use Test::Most;

if(not $ENV{AUTHOR_TESTING}) {
plan(skip_all => 'Author tests not required for installation');
}

eval "use Test::Pod::LinkCheck";
if($@) {
plan skip_all => 'Test::Pod::LinkCheck required for testing POD';
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 {
Test::Pod::LinkCheck->new->all_pod_ok();
plan(skip_all => 'Author tests not required for installation');
}

0 comments on commit a8f9026

Please sign in to comment.