test_requires 'File::Spec';
test_requires 'Test::More' => '0.88';
test_requires 'Test::Exception' => '0.27';
+test_requires 'Test::Requires' => '0.05';
repository 'git://git.moose.perl.org/Class-MOP.git';
add_metadata(x_authority => 'cpan:STEVAN');
use Test::More;
-BEGIN {
- eval "use SUPER 1.10";
- plan skip_all => "SUPER 1.10 required for this test" if $@;
-}
+use Test::Requires {
+ 'SUPER' => 1.10, # skip all if not installed
+};
=pod
use File::Spec;
use Class::MOP;
+use Test::Requires {
+ 'Algorithm::C3' => '0.01', # skip all if not installed
+};
+
BEGIN {
- eval "use Algorithm::C3";
- plan skip_all => "Algorithm::C3 required for this test" if $@;
require_ok(File::Spec->catfile('examples', 'C3MethodDispatchOrder.pod'));
}
use Test::More;
-BEGIN {
- eval "use Test::Output;";
- plan skip_all => "Test::Output is required for this test" if $@;
-}
+use Test::Requires {
+ 'Test::Output' => '0.01', # skip all if not installed
+};
use Class::MOP;
use Class::MOP;
use Test::More;
-BEGIN {
- eval "use Test::LeakTrace;";
- plan skip_all => "Test::LeakTrace is required for this test" if $@;
-}
+use Test::Requires {
+ 'Test::LeakTrace' => '0.01', # skip all if not installed
+};
# 5.10.0 has a bug on weaken($hash_ref) which leaks an AV.
my $expected = ( $] == 5.010_000 ? 1 : 0 );
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();
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.
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
+};
for my $file ( qw( mop.c mop.h ), glob "xs/*xs" ) {
notabs_ok( $file, "$file is tab free" );