add changelog
[gitmo/MooseX-Types-UUID.git] / t / 01-basic.t
CommitLineData
316d7a7e 1use strict;
2use warnings;
3use Test::Exception;
4use Test::More tests => 2;
5
6{ package Class;
7 use Moose;
8 use MooseX::Types::UUID qw(UUID);
9
10 has 'uuid' => ( is => 'ro', isa => UUID );
11}
12
13lives_ok {
14 Class->new( uuid => '77C71F92-0EC7-11DD-B986-DF138EE79F6F' );
15} 'valid UUID works';
16
17throws_ok {
18 Class->new( uuid => 'there is no way you could possibly think this is a UUID' );
19} qr/does not pass the type constraint/;