Add tests for natatime_curried
[gitmo/Moose.git] / t / 040_type_constraints / 001_util_type_constraints.t
index cf4e7e5..c7c611e 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 85;
+use Test::More;
 use Test::Exception;
 
 use Scalar::Util ();
@@ -104,7 +104,7 @@ ok(!$natural->has_message, '... it does not have a message');
 ok(!defined($natural->validate(5)), '... validated successfully (no error)');
 
 is($natural->validate(-5),
-  "Validation failed for 'Natural' failed with value -5",
+  "Validation failed for 'Natural' with value -5",
   '... validated unsuccessfully (got error)');
 
 my $string = find_type_constraint('String');
@@ -194,6 +194,11 @@ throws_ok {$r->add_type_constraint(bless {}, 'SomeClass')} qr/not a valid type c
 # sugar was indistinguishable from calling directly.
 
 {
+    no warnings 'redefine';
+    *Moose::Deprecated::deprecated = sub { return };
+}
+
+{
     my $type = type( 'Number2', sub { Scalar::Util::looks_like_number($_) } );
 
     ok( $type->check(5), '... this is a Num' );
@@ -225,3 +230,4 @@ throws_ok {$r->add_type_constraint(bless {}, 'SomeClass')} qr/not a valid type c
     ok( ! $subtype->check('Foo'), '... this is not a Natural');
 }
 
+done_testing;