Commit | Line | Data |
---|---|---|
316d7a7e | 1 | use strict; |
2 | use warnings; | |
3 | use Test::Exception; | |
4 | use 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 | ||
13 | lives_ok { | |
14 | Class->new( uuid => '77C71F92-0EC7-11DD-B986-DF138EE79F6F' ); | |
15 | } 'valid UUID works'; | |
16 | ||
17 | throws_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/; |