X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fbasics%2Fdeprecations.t;h=2466f6f32708089fa55f788a7bb2b3528a6edc9d;hb=e0a39158e1eb71c04a75423568bf84544caf535b;hp=9a8a4c0775facee2d26018847e78d9b50f0b30f7;hpb=680b7c2739d9bc952a21805e16a8060c9f6f8283;p=gitmo%2FMoose.git diff --git a/t/basics/deprecations.t b/t/basics/deprecations.t index 9a8a4c0..2466f6f 100644 --- a/t/basics/deprecations.t +++ b/t/basics/deprecations.t @@ -157,5 +157,20 @@ use Test::Requires { sub _build_foo { q{} } } +{ + use Moose::Util::TypeConstraints; + + is( + exception { + stderr_like { + subtype 'Frubble', as 'Str', optimize_as sub { }; + } + qr/\QProviding an optimized subroutine ref for type constraints is deprecated./, + 'Providing an optimize_as sub is deprecated'; + }, + undef + ); +} + done_testing;