From: Karen Etheridge Date: Tue, 24 Aug 2010 23:55:16 +0000 (-0700) Subject: more convert to using Test::Requires X-Git-Tag: 0.27~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Singleton.git;a=commitdiff_plain;h=42c0634336fede6dd9ef469f600828bd213e941d more convert to using Test::Requires --- diff --git a/xt/author/pod-coverage.t b/xt/author/pod-coverage.t index 5b5d246..21c64a5 100644 --- a/xt/author/pod-coverage.t +++ b/xt/author/pod-coverage.t @@ -5,8 +5,9 @@ use warnings; use Test::More; -eval "use Test::Pod::Coverage 1.04"; -plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; +use Test::Requires { + 'Test::Pod::Coverage' => '1.04', # skip all if not installed +}; # This is a stripped down version of all_pod_coverage_ok which lets us # vary the trustme parameter per module. diff --git a/xt/author/pod-spell.t b/xt/author/pod-spell.t index 904a236..fa10955 100644 --- a/xt/author/pod-spell.t +++ b/xt/author/pod-spell.t @@ -2,8 +2,10 @@ use strict; use warnings; use Test::More; -eval 'use Test::Spelling;'; -plan skip_all => "Test::Spelling required for testing POD spelling" if $@; + +use Test::Requires { + 'Test::Spelling' => '0.01', # skip all if not installed +}; my @stopwords; for () { diff --git a/xt/author/pod.t b/xt/author/pod.t index 4ae1af3..5627f22 100644 --- a/xt/author/pod.t +++ b/xt/author/pod.t @@ -5,7 +5,8 @@ use warnings; use Test::More; -eval "use Test::Pod 1.14"; -plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; +use Test::Requires { + 'Test::Pod' => '1.14', # skip all if not installed +}; all_pod_files_ok(); diff --git a/xt/author/tabs.t b/xt/author/tabs.t index 1b9c5b9..b794cee 100644 --- a/xt/author/tabs.t +++ b/xt/author/tabs.t @@ -5,8 +5,9 @@ use warnings; use Test::More; -eval "use Test::NoTabs 0.8"; -plan skip_all => "Test::NoTabs 0.8 required for testing tabs" if $@; +use Test::Requires { + 'Test::NoTabs' => '0.8', # skip all if not installed +}; # Module::Install has tabs, so we can't check 'inc' or ideally '.' all_perl_files_ok('lib', 't', 'xt'); diff --git a/xt/author/version-numbers.t b/xt/author/version-numbers.t index cdeaad4..86557f7 100644 --- a/xt/author/version-numbers.t +++ b/xt/author/version-numbers.t @@ -3,13 +3,10 @@ use warnings; use Test::More; -eval <<'EOF'; -use File::Find::Rule; -use Module::Info; -EOF - -plan skip_all => 'File::Find::Rule and Module::Info required for testing version numbers' if $@; - +use Test::Requires { + 'File::Find::Rule' => '0.01', # skip all if not installed + 'Module::Info' => '0.01', +}; my %versions; for my $pm_file ( File::Find::Rule->file->name( qr/\.pm$/ )->in('lib' ) ) {