use strict;
use warnings;
-use Test::More qw(no_plan);
+use Test::More;
use Test::Exception;
{
use Moose::Util::TypeConstraints;
duck_type 'DuckType' => qw(quack);
+ duck_type 'SwanType' => [qw(honk)];
has duck => (
isa => 'DuckType',
is => 'ro',
);
+ has other_swan => (
+ isa => 'SwanType',
+ is => 'ro',
+ );
+
}
# try giving it a duck
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;