From: Karen Etheridge Date: Tue, 27 Jun 2017 21:37:05 +0000 (-0700) Subject: switch from eval/require to Test::Needs X-Git-Tag: v1.017~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Authentication-Credential-HTTP.git;a=commitdiff_plain;h=419d9af2e5aeab6a45381261557ec6be26b6dbc9 switch from eval/require to Test::Needs --- diff --git a/dist.ini b/dist.ini index 8780532..575aa81 100644 --- a/dist.ini +++ b/dist.ini @@ -25,6 +25,8 @@ Catalyst::Plugin::Authentication = 0.10005 [Prereqs / DevelopRequires] Test::WWW::Mechanize::Catalyst = 0.51 +Catalyst::Plugin::Cache = 0 +Cache::FileCache = 0 [MetaResources] x_IRC = irc://irc.perl.org/#catalyst diff --git a/t/live_app.t b/t/live_app.t index ea3e5c6..95ae56b 100644 --- a/t/live_app.t +++ b/t/live_app.t @@ -5,15 +5,7 @@ use FindBin qw/$Bin/; use lib "$Bin/lib"; use Test::More; -BEGIN { - do { - eval { require Test::WWW::Mechanize::Catalyst } - and - Test::WWW::Mechanize::Catalyst->VERSION('0.51') - } - or plan skip_all => - "Test::WWW::Mechanize::Catalyst is needed for this test"; -} +use Test::Needs { 'Test::WWW::Mechanize::Catalyst' => '0.51' }; use HTTP::Request; use Test::More; diff --git a/t/live_app_digest.t b/t/live_app_digest.t index 1a96d15..56894a4 100644 --- a/t/live_app_digest.t +++ b/t/live_app_digest.t @@ -3,22 +3,14 @@ use warnings; use FindBin qw/$Bin/; use lib "$Bin/lib"; use Test::More; -BEGIN { - do { - eval { require Test::WWW::Mechanize::Catalyst } - and - Test::WWW::Mechanize::Catalyst->VERSION('0.51') - } - or plan skip_all => - "Test::WWW::Mechanize::Catalyst is needed for this test"; - eval { require Catalyst::Plugin::Cache } - or plan skip_all => - "Catalyst::Plugin::Cache is needed for this test"; - eval { require Cache::FileCache } - or plan skip_all => - "Cache::FileCache is needed for this test"; - plan tests => 12; -} +use Test::Needs { + 'Test::WWW::Mechanize::Catalyst' => '0.51', + 'Catalyst::Plugin::Cache' => '0', + 'Cache::FileCache' => undef, +}; + +plan tests => 12; + use Digest::MD5; use HTTP::Request; use Test::More; diff --git a/t/live_app_digest_dotnet.t b/t/live_app_digest_dotnet.t index 415b148..6149d93 100644 --- a/t/live_app_digest_dotnet.t +++ b/t/live_app_digest_dotnet.t @@ -3,22 +3,14 @@ use warnings; use FindBin qw/$Bin/; use lib "$Bin/lib"; use Test::More; -BEGIN { - do { - eval { require Test::WWW::Mechanize::Catalyst } - and - Test::WWW::Mechanize::Catalyst->VERSION('0.51') - } - or plan skip_all => - "Test::WWW::Mechanize::Catalyst is needed for this test"; - eval { require Catalyst::Plugin::Cache } - or plan skip_all => - "Catalyst::Plugin::Cache is needed for this test"; - eval { require Cache::FileCache } - or plan skip_all => - "Cache::FileCache is needed for this test"; - plan tests => 19; -} +use Test::Needs { + 'Test::WWW::Mechanize::Catalyst' => '0.51', + 'Catalyst::Plugin::Cache' => '0', + 'Cache::FileCache' => undef, +}; + +plan tests => 19; + use Digest::MD5; use HTTP::Request; use Test::More;