From: gfx Date: Tue, 29 Sep 2009 08:45:10 +0000 (+0900) Subject: Add a test for deprecated feature X-Git-Tag: 0.37_01~29 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b20f7ca9c90953009e789c45ff6cff0e9571b8b5;p=gitmo%2FMouse.git Add a test for deprecated feature --- diff --git a/t/990_deprecated/990-undefined-class-type.t b/t/990_deprecated/990-undefined-class-type.t new file mode 100755 index 0000000..4a5e314 --- /dev/null +++ b/t/990_deprecated/990-undefined-class-type.t @@ -0,0 +1,26 @@ +#!perl + +use strict; +use warnings; +use Test::More tests => 5; + +use Mouse::Util::TypeConstraints; + +my $z = Mouse::Util::TypeConstraints::find_or_create_isa_type_constraint('My::New::Class | Str'); + +#diag $z->dump; + +eval q{ + package My::New::Class; + use Mouse; + package My::New::DerivedClass; + use Mouse; + extends 'My::New::Class'; +}; + +ok $z->check(My::New::Class->new); +ok $z->check(My::New::DerivedClass->new); +ok $z->check('Foo'); +ok!$z->check(undef); +ok!$z->check(bless {}, 'Foo'); +