diff --git a/Changes b/Changes index e8c4ed8..820a131 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ Revision history for Geo-Coder-List 0.34 Turn off on-line tests for smokers + Use Test::DescribeMe to simplify tests 0.33 Thu May 16 09:28:54 EDT 2024 Fix test count in t/googleplaces.t diff --git a/t/changes.t b/t/changes.t index 5f949ac..be8e2eb 100644 --- a/t/changes.t +++ b/t/changes.t @@ -2,14 +2,12 @@ use strict; use warnings; + +use Test::DescribeMe qw(author); use Test::Most; +use Test::Needs 'Test::CPAN::Changes'; -# if($ENV{AUTHOR_TESTING}) { - # eval 'use Test::CPAN::Changes'; - # plan(skip_all => 'Test::CPAN::Changes required for this test') if $@; - # changes_ok(); -# } else { - # plan(skip_all => 'Author tests not required for installation'); -# } +Test::Needs->import(); +# changes_ok(); plan(skip_all => "I don't agree with the author's format for dates"); diff --git a/t/comment-spelling.t b/t/comment-spelling.t index d10bafe..6a116f3 100644 --- a/t/comment-spelling.t +++ b/t/comment-spelling.t @@ -1,20 +1,15 @@ -#!perl +#!usr/bin/env perl 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()->all_files_ok(); - } -} else { - plan(skip_all => 'Author tests not required for installation'); -} +Test::Spelling::Comment->import(); +Test::Spelling::Comment->new()->add_stopwords()->all_files_ok(); __DATA__ ArcGIS diff --git a/t/critic.t b/t/critic.t index a2206d9..0ecea67 100644 --- a/t/critic.t +++ b/t/critic.t @@ -2,16 +2,11 @@ use strict; use warnings; + +use Test::DescribeMe qw(author); use File::Spec; use Test::Most; +use Test::Needs 'Test::Perl::Critic'; use English qw(-no_match_vars); -unless($ENV{AUTHOR_TESTING}) { - plan(skip_all => 'Author tests not required for installation'); -} - -eval "use Test::Perl::Critic"; - -plan(skip_all => 'Test::Perl::Critic not installed; skipping') if $@; - -all_critic_ok(); +Test::Perl::Critic::all_critic_ok(); diff --git a/t/cv.t b/t/cv.t index f2dc4c0..cf2d6ec 100644 --- a/t/cv.t +++ b/t/cv.t @@ -2,14 +2,9 @@ use strict; use warnings; -use Test::Most; - -if(!$ENV{'AUTHOR_TESTING'}) { - plan(skip_all => 'Author tests not required for installation'); -} -eval 'use Test::ConsistentVersion'; - -plan(skip_all => 'Test::ConsistentVersion required for checking versions') if $@; +use Test::DescribeMe qw(author); +use Test::Most; +use Test::Needs 'Test::ConsistentVersion'; Test::ConsistentVersion::check_consistent_versions(); diff --git a/t/dist.t b/t/dist.t index b8b3d67..c0d95ec 100644 --- a/t/dist.t +++ b/t/dist.t @@ -3,19 +3,8 @@ use strict; use warnings; +use Test::DescribeMe qw(author); use Test::Most; +use Test::Needs 'Test::Distribution'; -BEGIN { - if($ENV{'AUTHOR_TESTING'}) { - eval { - require Test::Distribution; - }; - if($@) { - plan(skip_all => 'Test::Distribution not installed'); - } else { - Test::Distribution->import(); - } - } else { - plan(skip_all => 'Author tests not required for installation'); - } -} +Test::Distribution->import(); diff --git a/t/eof.t b/t/eof.t index b30f021..a50018d 100644 --- a/t/eof.t +++ b/t/eof.t @@ -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 }); diff --git a/t/eol.t b/t/eol.t index 2465d3c..fbe9b40 100644 --- a/t/eol.t +++ b/t/eol.t @@ -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 }); diff --git a/t/kwalitee.t b/t/kwalitee.t index 531bd16..298f726 100644 --- a/t/kwalitee.t +++ b/t/kwalitee.t @@ -1,16 +1,13 @@ use strict; use warnings; +use Test::DescribeMe qw(author); use Test::Most; -if($ENV{AUTHOR_TESTING}) { - eval "use Test::Kwalitee tests => [ qw( -has_meta_yml ) ]"; +eval "use Test::Kwalitee tests => [ qw( -has_meta_yml ) ]"; - if($@) { - plan(skip_all => 'Test::Kwalitee not installed; skipping') if $@; - } else { - unlink('Debian_CPANTS.txt') if -e 'Debian_CPANTS.txt'; - } +if($@) { + plan(skip_all => 'Test::Kwalitee not installed; skipping') if $@; } else { - plan(skip_all => 'Author tests not required for installation'); + unlink('Debian_CPANTS.txt') if -e 'Debian_CPANTS.txt'; } diff --git a/t/noplan.t b/t/noplan.t index 0990cdd..e6f740a 100644 --- a/t/noplan.t +++ b/t/noplan.t @@ -3,16 +3,13 @@ use strict; use warnings; +use Test::DescribeMe qw(author); use Test::Most; -if($ENV{'AUTHOR_TESTING'}) { - eval 'use Test::NoPlan qw / all_plans_ok /'; +eval 'use Test::NoPlan qw / all_plans_ok /'; - if($@) { - plan(skip_all => 'Test::NoPlan required for test verification'); - } else { - all_plans_ok(); - } +if($@) { + plan(skip_all => 'Test::NoPlan required for test verification'); } else { - plan(skip_all => 'Author tests not required for installation'); + all_plans_ok(); } diff --git a/t/pod-synopsis.t b/t/pod-synopsis.t index 1ae87ea..b23dd8c 100644 --- a/t/pod-synopsis.t +++ b/t/pod-synopsis.t @@ -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(); diff --git a/t/pod.t b/t/pod.t index 0be9e38..29d7bc6 100644 --- a/t/pod.t +++ b/t/pod.t @@ -2,15 +2,11 @@ use strict; use warnings; + +use Test::DescribeMe qw(author); use Test::Most; +use Test::Needs { 'Test::Pod' => '1.22' }; -if($ENV{'AUTHOR_TESTING'}) { - # Ensure a recent version of Test::Pod - my $min_tp = 1.22; - eval "use Test::Pod $min_tp"; - plan(skip_all => "Test::Pod $min_tp required for testing POD") if $@; +Test::Pod->import(); - all_pod_files_ok(); -} else { - plan(skip_all => 'Author tests not required for installation'); -} +all_pod_files_ok(); diff --git a/t/used.t b/t/used.t index 52ac9da..8a791ef 100644 --- a/t/used.t +++ b/t/used.t @@ -1,16 +1,10 @@ #!perl -w use strict; -use Test::Most; -unless($ENV{'AUTHOR_TESTING'}) { - plan(skip_all => 'Author tests not required for installation'); -} +use Test::DescribeMe qw(author); +use Test::Most; +use Test::Needs 'Test::Module::Used'; -eval 'use Test::Module::Used'; -if($@) { - plan(skip_all => 'Test::Module::Used required for testing all modules needed'); -} else { - my $used = Test::Module::Used->new(meta_file => 'MYMETA.yml'); - $used->ok(); -} +my $used = Test::Module::Used->new(meta_file => 'MYMETA.yml'); +$used->ok(); diff --git a/t/vars.t b/t/vars.t index 16fa4e6..46622a5 100644 --- a/t/vars.t +++ b/t/vars.t @@ -3,12 +3,9 @@ use strict; use warnings; +use Test::DescribeMe qw(author); use Test::Most; use Test::Needs 'Test::Vars'; -if($ENV{'AUTHOR_TESTING'}) { - Test::Vars->import(); - all_vars_ok(ignore_vars => { '$self' => 0 }); -} else { - plan(skip_all => 'Author tests not required for installation'); -} +Test::Vars->import(); +all_vars_ok(ignore_vars => { '$self' => 0 });