From: Karen Etheridge Date: Fri, 21 Jun 2013 01:45:33 +0000 (-0700) Subject: use Test::Requires for optional deps X-Git-Tag: v0.006014~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d5a4de482c43bead8a87003b9fe640d479a9f1a3;p=p5sagit%2FDevel-Declare.git use Test::Requires for optional deps --- diff --git a/Makefile.PL b/Makefile.PL index 7e97428..b965a35 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -21,6 +21,7 @@ configure_requires 'ExtUtils::Depends' => 0.302; configure_requires 'B::Hooks::OP::Check' => '0.19'; test_requires 'Test::More' => '0.88'; +test_requires 'Test::Requires' => '0'; # r/w: p5sagit@git.shadowcat.co.uk:Devel-Declare.git repository 'git://git.shadowcat.co.uk/p5sagit/Devel-Declare.git'; diff --git a/t/devel_callparser.t b/t/devel_callparser.t index e45b6cf..ec62c68 100644 --- a/t/devel_callparser.t +++ b/t/devel_callparser.t @@ -1,15 +1,10 @@ use warnings; use strict; -BEGIN { - eval { require Devel::CallParser }; - if($@ ne "") { - require Test::More; - Test::More::plan(skip_all => "Devel::CallParser unavailable"); - } -} +use Test::More; +use Test::Requires 'Devel::CallParser'; -use Test::More tests => 1; +plan tests => 1; use Devel::CallParser (); diff --git a/t/filter0.t b/t/filter0.t index b84b402..0295b48 100644 --- a/t/filter0.t +++ b/t/filter0.t @@ -1,17 +1,13 @@ use warnings; use strict; -BEGIN { - eval { require Filter::Util::Call }; - if($@ ne "") { - require Test::More; - Test::More::plan(skip_all => "Filter::Util::Call unavailable"); - } -} +use Test::More; +use Test::Requires 'Filter::Util::Call'; + +plan tests => 2; use Devel::Declare (); use Filter::Util::Call qw(filter_add filter_del); -use Test::More tests => 2; sub my_quote($) { $_[0] } diff --git a/t/filter1.t b/t/filter1.t index 0240290..088f827 100644 --- a/t/filter1.t +++ b/t/filter1.t @@ -1,17 +1,13 @@ use warnings; use strict; -BEGIN { - eval { require Filter::Util::Call }; - if($@ ne "") { - require Test::More; - Test::More::plan(skip_all => "Filter::Util::Call unavailable"); - } -} +use Test::More; +use Test::Requires 'Filter::Util::Call'; + +plan tests => 2; use Devel::Declare (); use Filter::Util::Call qw(filter_add filter_del); -use Test::More tests => 2; sub my_quote($) { $_[0] } diff --git a/t/lines.t b/t/lines.t index 8927ad2..ed1f605 100644 --- a/t/lines.t +++ b/t/lines.t @@ -2,12 +2,8 @@ use strict; use warnings; use Test::More; -BEGIN { - eval 'use B::Compiling'; - - $@ and plan 'skip_all' => $@ - or plan tests => 5; -} +use Test::Requires 'B:Compiling'; +plan tests => 5; my @lines;