From: Hinrik Örn Sigurðsson Date: Mon, 25 Jan 2010 19:26:20 +0000 (+0000) Subject: Skip relevants tests when appropriate X-Git-Tag: 0.27~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=655594899dc90c925b5c3b1653b6a18f9bb5ace9;p=gitmo%2FMooseX-Getopt.git Skip relevants tests when appropriate --- diff --git a/t/011_version_options.t b/t/011_version_options.t index 2385ebb..09bce03 100644 --- a/t/011_version_options.t +++ b/t/011_version_options.t @@ -20,16 +20,20 @@ for my $opt (qw(-v --version -V)) { for my $test (qw(version_with_options.pl version_with_simpleconfig.pl)) { my $script = catfile('t', $test); - next if $test eq 'version_with_simpleconfig.pl' && !$HAVE_SIMPLECONFIG; + SKIP: { + if ($test eq 'version_with_simpleconfig.pl' && !$HAVE_SIMPLECONFIG) { + skip('MooseX::SimpleConfig unavailable', 3); + } - my ($v, undef) = capture { system $^X, $script, '-v' }; - like($v, qr/^SUCCESS/, "Option -v is correct"); + my ($v, undef) = capture { system $^X, $script, '-v' }; + like($v, qr/^SUCCESS/, "Option -v is correct"); - my ($version, undef) = capture { system $^X, $script, '--version' }; - like($version, qr/^SUCCESS/, "Option --version is correct"); + my ($version, undef) = capture { system $^X, $script, '--version' }; + like($version, qr/^SUCCESS/, "Option --version is correct"); - my (undef, $V) = capture { system $^X, $script, '-V' }; - like($V, qr/^Unknown option/, "Option -V is unknown"); + my (undef, $V) = capture { system $^X, $script, '-V' }; + like($V, qr/^Unknown option/, "Option -V is unknown"); + } } done_testing();