X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F040_type_constraints%2F001_util_type_constraints.t;h=c7c611e9b1c44d3a1bbc80417005cbb8cfd3a295;hb=53a4d826caec4b82f5b23e0bc0a4e8e2f44243b9;hp=b0e6069064ac123bc04ad8d236e94d3f064fe1f7;hpb=a28e50e44945358d15eb19e4688573741a319fe0;p=gitmo%2FMoose.git diff --git a/t/040_type_constraints/001_util_type_constraints.t b/t/040_type_constraints/001_util_type_constraints.t index b0e6069..c7c611e 100644 --- a/t/040_type_constraints/001_util_type_constraints.t +++ b/t/040_type_constraints/001_util_type_constraints.t @@ -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' );