Use done_testing in all tests and use Test::Requires
Dave Rolsky [Mon, 8 Nov 2010 15:59:01 +0000 (09:59 -0600)]
14 files changed:
Makefile.PL
t/10_moose-types.t
t/11_library-definition.t
t/12_wrapper-definition.t
t/13_typedecorator.t
t/14_compatibility-sub-exporter.t
t/15_recursion.t
t/16_introspection.t
t/17_syntax_errors.t
t/18_combined_libs.t
t/19_typelib_with_role.t
t/20_union_with_string_type.t
t/21_coerce_parameterized_types.t
t/regressions/01-is_subtype_of.t

index 06a4181..b0f7b89 100644 (file)
@@ -9,10 +9,11 @@ license         q{perl};
 author          q{Robert "phaylon" Sedlacek <rs@474.at>};
 all_from        q{lib/MooseX/Types.pm};
 
-build_requires  q{Test::More},                  '0.80';
+build_requires  q{Test::More},                  '0.88';
 build_requires  q{FindBin},                     0;
 build_requires  q{Test::Moose},                 0;
 build_requires  q{Test::Fatal},                 0;
+build_requires  q{Test::Requires},              0;
 
 requires        q{Moose},                       '1.06';
 requires        q{Sub::Install},                '0.924';
index fd5508b..4039aca 100644 (file)
@@ -9,8 +9,6 @@ use MooseX::Types::Moose ':all', 'Bool';
 
 my @types = MooseX::Types::Moose->type_names;
 
-plan tests => @types * 3;
-
 for my $t (@types) {
     ok my $code = __PACKAGE__->can($t), "$t() was exported";
     if ($code) {
@@ -22,3 +20,4 @@ for my $t (@types) {
     ok __PACKAGE__->can("is_$t"), "is_$t() was exported";
 }
 
+done_testing;
index 5aec836..484d597 100644 (file)
@@ -13,8 +13,6 @@ my @tests = (
     [ 'IntArrayRef', 12, [12], {}, [17, 23], {} ],
 );
 
-plan tests => (@tests * 8) + 5;
-
 # new array ref so we can safely shift from it
 for my $data (map { [@$_] } @tests) {
     my $type = shift @$data;
@@ -52,3 +50,5 @@ ok ! __PACKAGE__->can('to_TwentyThree'), "type without coercion doesn't have to_
 eval { require TestNamespaceSep };
 ok   $@,                q(trying to declare a type with '::' in it croaks);
 like $@, qr/Foo::Bar/,  q(error message contains type name);
+
+done_testing;
index f2d0f77..9284eec 100644 (file)
@@ -17,8 +17,6 @@ my @tests = (
     [ 'Str',         'Str',                      12, "12", [], "foo", [777] ],
 );
 
-plan tests => (@tests * 9);
-
 # new array ref so we can safely shift from it
 for my $data (map { [@$_] } @tests) {
     my $type = shift @$data;
@@ -49,4 +47,4 @@ for my $data (map { [@$_] } @tests) {
     }
 }
 
-
+done_testing;
index 949bf5a..1bf9329 100644 (file)
@@ -2,7 +2,7 @@
 use warnings;
 use strict;
 
-use Test::More tests => 62;
+use Test::More;
 use Test::Fatal;
 use FindBin;
 use lib "$FindBin::Bin/lib";
@@ -277,6 +277,4 @@ like exception {
 }, qr/Attribute \(WierdIntergersArrayRef2_attr\) does not pass the type constraint/
  => 'Constraints properly fail';
 
-
-
-
+done_testing();
index 1a250f1..04a233d 100644 (file)
@@ -5,10 +5,7 @@ BEGIN {
     use FindBin;
     use lib "$FindBin::Bin/lib";   
     
-    eval "use Sub::Exporter";
-    plan $@
-        ? ( skip_all => "Tests require Sub::Exporter" )
-        : ( tests => 3 );
+    use Test::Requires { 'Sub::Exporter' => '0' };
 }
 
 use SubExporterCompatibility qw(MyStr something);
@@ -16,3 +13,5 @@ use SubExporterCompatibility qw(MyStr something);
 ok MyStr->check('aaa'), "Correctly passed";
 ok !MyStr->check([1]), "Correctly fails";
 ok something(), "Found the something method";
+
+done_testing;
index 6d81b73..4bafb43 100644 (file)
@@ -20,7 +20,7 @@ BEGIN {
     package MooseX::Types::Test::Recursion::TestRunner;
     
     BEGIN {
-        use Test::More tests=>5;
+        use Test::More;
         
         ## Grab the newly created test type constraint
         MooseX::Types::Test::Recursion->import(':all');
@@ -48,10 +48,6 @@ BEGIN {
      
     ok ! RecursiveHashRef->check({key=>{subkey=>"value",subkey2=>{ssubkey=>[1,2,3]}}})
      => 'Properly invalidates bad value deeply';
-}
-
-
-
-
-
 
+    done_testing;
+}
index b4821e3..f2f04e4 100644 (file)
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 2;
+use Test::More;
 
 use FindBin;
 use lib "$FindBin::Bin/lib";
@@ -56,3 +56,4 @@ is_deeply(IntrospectTypeExports->get_memory, [
 
 ], 'all calls to has_available_type_export returned correct results');
 
+done_testing();
index 67d7432..fa6b853 100644 (file)
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 5;
+use Test::More;
 
 # remove this when CheckedUtilExports croaks instead of carps
 $SIG{__WARN__} = sub { die @_ };
@@ -91,3 +91,5 @@ my $role_type = q{
 };
 eval $role_type;
 is $@, '', "declared role_types don't throw error";
+
+done_testing();
index 23ba549..6ef2191 100644 (file)
@@ -4,7 +4,7 @@ use warnings;
 use FindBin;
 use lib "$FindBin::Bin/lib";
 
-use Test::More tests => 7;
+use Test::More;
 use Test::Fatal;
 
 BEGIN { use_ok 'Combined', qw/Foo2Alias MTFNPY NonEmptyStr/ }
@@ -35,3 +35,5 @@ qr/\Qmain asked for a type (NonExistentType) which is not found in any of the ty
     qr/Can't locate DoesNotExist\.pm/,
     'cannot combine types from a package which does not exist';
 }
+
+done_testing();
index af5acd0..b979d40 100644 (file)
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
  
-use Test::More tests => 1;
+use Test::More;
 
 {
     package MyRole;
@@ -24,3 +24,5 @@ eval q{
 };
 
 ok !$@, 'type export not picked up as a method on role application';
+
+done_testing();
index 2b0bdfa..8147f86 100644 (file)
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 14;
+use Test::More;
 
 my $exception;
 {
@@ -48,3 +48,5 @@ my $exception;
        Test::More::ok !Test3->check({a=>1}), 'fails wrong ref type';
        Test::More::ok Test3->check($obj), 'Union allows Object';
 }
+
+done_testing();
index 4a25a1f..4a4cf9c 100644 (file)
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 2;
+use Test::More;
 
 BEGIN {
     package TypeLib;
@@ -46,3 +46,4 @@ BEGIN {
     ::ok( $subtype->has_coercion, 'coercion applied to subtype' );
 }
 
+done_testing();
index 87e5382..0fe59c1 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests=>5;
+use Test::More;
 use MooseX::Types;
 use MooseX::Types::Moose qw(Any Item );
 
@@ -20,3 +20,4 @@ ok ( Item->is_subtype_of('Any'),
 ok ( Item->is_subtype_of(Any),
   q[Item is subtype of Any]);
 
+done_testing;