Test::Exception = 0.21
Test::Warn = 0.21
Test::More = 0.88
+Test::Requires = 0.05
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;
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;
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;
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;
{