From: Karen Etheridge Date: Mon, 16 Aug 2010 20:47:42 +0000 (-0700) Subject: convert to using Test::Requires X-Git-Tag: 0.33~2^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6a378fbdc3c4c5ca5b9f4de5e2ad60da912e9f97;p=gitmo%2FMooseX-Getopt.git convert to using Test::Requires --- diff --git a/dist.ini b/dist.ini index dc08666..9f79b47 100644 --- a/dist.ini +++ b/dist.ini @@ -29,3 +29,4 @@ Moose = 0.56 Test::Exception = 0.21 Test::Warn = 0.21 Test::More = 0.88 +Test::Requires = 0.05 diff --git a/t/008_configfromfile.t b/t/008_configfromfile.t index 62e6ed9..9ea94c8 100644 --- a/t/008_configfromfile.t +++ b/t/008_configfromfile.t @@ -3,18 +3,13 @@ use strict; use warnings; +use Test::More tests => 37; use Test::Exception; -use Test::More; use File::Spec; -if ( !eval { require MooseX::ConfigFromFile } ) -{ - plan skip_all => 'Test requires MooseX::ConfigFromFile'; -} -else -{ - plan tests => 37; -} +use Test::Requires { + 'MooseX::ConfigFromFile' => 0.01, # skip all if not installed +}; { package App; diff --git a/t/009_gld_and_explicit_options.t b/t/009_gld_and_explicit_options.t index aa2761c..dadceb2 100644 --- a/t/009_gld_and_explicit_options.t +++ b/t/009_gld_and_explicit_options.t @@ -3,15 +3,14 @@ use strict; use warnings; -use Test::More; +use Test::More tests => 5; use Test::Exception; -BEGIN { - eval 'use Getopt::Long::Descriptive;'; - plan skip_all => "Getopt::Long::Descriptive required for this test" if $@; - plan tests => 5; - use_ok('MooseX::Getopt'); -} +use Test::Requires { + 'Getopt::Long::Descriptive' => 0.01, # skip all if not installed +}; + +use_ok('MooseX::Getopt'); { package Testing::Foo; diff --git a/t/100_gld_default_bug.t b/t/100_gld_default_bug.t index 29ae2a4..a7dc478 100644 --- a/t/100_gld_default_bug.t +++ b/t/100_gld_default_bug.t @@ -3,15 +3,14 @@ use strict; use warnings; -use Test::More; +use Test::More tests => 5; use Test::Exception; -BEGIN { - eval 'use Getopt::Long::Descriptive;'; - plan skip_all => "Getopt::Long::Descriptive required for this test" if $@; - plan tests => 5; - use_ok('MooseX::Getopt'); -} +use Test::Requires { + 'Getopt::Long::Descriptive' => 0.01, # skip all if not installed +}; + +use_ok('MooseX::Getopt'); { package Engine::Foo; diff --git a/t/107_no_auto_help.t b/t/107_no_auto_help.t index 5521bc2..c69e153 100644 --- a/t/107_no_auto_help.t +++ b/t/107_no_auto_help.t @@ -12,10 +12,9 @@ use warnings; use Test::More; -BEGIN { -plan skip_all => 'This test needs MooseX::SimpleConfig 0.07' - unless eval { require MooseX::SimpleConfig && MooseX::SimpleConfig->VERSION(0.07); }; -} +use Test::Requires { + 'MooseX::SimpleConfig' => 0.07, # skip all if not installed +}; my $fail_on_exit = 1; {