Deprecate _default_is and _default_default for native traits.
[gitmo/Moose.git] / t / 040_type_constraints / 034_duck_types.t
index a402ddb..5682793 100644 (file)
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More qw(no_plan);
+use Test::More;
 use Test::Exception;
 
 {
@@ -39,6 +39,7 @@ use Test::Exception;
     use Moose::Util::TypeConstraints;
 
     duck_type 'DuckType' => qw(quack);
+    duck_type 'SwanType' => [qw(honk)];
 
     has duck => (
         isa        => 'DuckType',
@@ -53,6 +54,11 @@ use Test::Exception;
         is => 'ro',
     );
 
+    has other_swan => (
+        isa => 'SwanType',
+        is => 'ro',
+    );
+
 }
 
 # try giving it a duck
@@ -70,3 +76,7 @@ lives_ok { DucktypeTest->new( swan => Swan->new ) } 'but a Swan can honk';
 lives_ok { DucktypeTest->new( duck => RubberDuck->new ) }
 'the RubberDuck lives okay';
 
+# try with the other constraint form
+lives_ok { DucktypeTest->new( other_swan => Swan->new ) } 'but a Swan can honk';
+
+done_testing;