From: Karen Etheridge Date: Mon, 16 Aug 2010 20:52:00 +0000 (-0700) Subject: convert to using Test::Requires, and add explicit test counts X-Git-Tag: v0.18~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3272340d933b46c2b98be10b1923170739ce3c8a;p=gitmo%2FMooseX-ClassAttribute.git convert to using Test::Requires, and add explicit test counts --- diff --git a/dist.ini b/dist.ini index d101e68..31a3faf 100644 --- a/dist.ini +++ b/dist.ini @@ -35,5 +35,6 @@ namespace::autoclean = 0 Test::More = 0.88 Test::Exception = 0 Scalar::Util = 0 +Test::Requires = 0.05 [@Git] diff --git a/t/04-with-native-traits.t b/t/04-with-native-traits.t index 22abd37..6ec2b8b 100644 --- a/t/04-with-native-traits.t +++ b/t/04-with-native-traits.t @@ -1,7 +1,7 @@ use strict; use warnings; -use Test::More; +use Test::More tests => 2; { package MyClass; @@ -23,4 +23,3 @@ is( MyClass->counter(), 0 ); MyClass->inc_counter(); is( MyClass->counter(), 1 ); -done_testing(); diff --git a/t/05-with-attribute-helpers-backcompat.t b/t/05-with-attribute-helpers-backcompat.t index 8605588..96cce5b 100644 --- a/t/05-with-attribute-helpers-backcompat.t +++ b/t/05-with-attribute-helpers-backcompat.t @@ -1,13 +1,12 @@ use strict; use warnings; -use Test::More; +use Test::More tests => 2; + +use Test::Requires { + 'MooseX::AttributeHelpers' => 0.23, # skip all if not installed +}; -BEGIN { - eval "use MooseX::AttributeHelpers 0.23;"; - plan skip_all => 'This test requires MooseX::AttributeHelpers 0.23+' - if $@; -} { package MyClass; @@ -29,4 +28,3 @@ is( MyClass->counter(), 0 ); MyClass->inc_counter(); is( MyClass->counter(), 1 ); -done_testing(); diff --git a/t/07-parameterized-role.t b/t/07-parameterized-role.t index f1d11db..09a8ddf 100644 --- a/t/07-parameterized-role.t +++ b/t/07-parameterized-role.t @@ -1,13 +1,12 @@ use strict; use warnings; -use Test::More; + +use Test::More tests => 3; use Test::Exception; -BEGIN { - unless (eval { require MooseX::Role::Parameterized }) { - plan skip_all => 'This test needs MooseX::Role::Parameterized'; - } -} +use Test::Requires { + 'MooseX::Role::Parameterized' => 0.23, # skip all if not installed +}; { package Role; @@ -34,4 +33,3 @@ lives_and { is $instance->foo, 'bar'; } 'used class attribute from parameterized role'; -done_testing; diff --git a/t/08-role-composition.t b/t/08-role-composition.t index 6cf2a02..6b99ed7 100644 --- a/t/08-role-composition.t +++ b/t/08-role-composition.t @@ -1,13 +1,13 @@ use strict; use warnings; -use Test::More; + +use Test::More tests => 1; use Test::Exception; lives_ok { Bar->new->_connections; } 'finds a class attribute under role composition'; -done_testing; BEGIN {