From: Arthur Axel 'fREW' Schmidt Date: Sat, 5 Sep 2009 06:29:37 +0000 (-0500) Subject: refactor for reuse (hopefully in skip_all) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c4aa7f83d550b6d8e8eb51a128e7e45f915ee4ea;p=gitmo%2FMoose.git refactor for reuse (hopefully in skip_all) --- diff --git a/t/lib/MetaTest.pm b/t/lib/MetaTest.pm index 9b41685..7f0e678 100644 --- a/t/lib/MetaTest.pm +++ b/t/lib/MetaTest.pm @@ -4,13 +4,21 @@ use Exporter 'import'; use Test::More; our @EXPORT = qw{skip_meta meta_can_ok}; +sub SKIP_META_MESSAGE() { + 'meta-tests disabled'; +} + +sub skip_meta_condition { + $ENV{SKIP_META_TESTS}; +} + sub skip_meta (&$) { my $fn = shift; my $amount = shift; local $Test::Builder::Level = $Test::Builder::Level + 1; SKIP: { local $Test::Builder::Level = $Test::Builder::Level + 1; - skip 'meta-tests disabled', $amount if $ENV{SKIP_META_TESTS}; + skip SKIP_META_MESSAGE, $amount if skip_meta_condition; $fn->(); }; }