X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F01-basic.t;fp=t%2F01-basic.t;h=7d8461a67f0a4d7137a2d35e334ed05186c7d628;hb=316d7a7eb65f9f8f65934435eb26f9ce4fbcabef;hp=0000000000000000000000000000000000000000;hpb=c2cadbcbd6b3e1ebb05b7ef7e3fbb364f293def2;p=gitmo%2FMooseX-Types-UUID.git diff --git a/t/01-basic.t b/t/01-basic.t new file mode 100644 index 0000000..7d8461a --- /dev/null +++ b/t/01-basic.t @@ -0,0 +1,19 @@ +use strict; +use warnings; +use Test::Exception; +use Test::More tests => 2; + +{ package Class; + use Moose; + use MooseX::Types::UUID qw(UUID); + + has 'uuid' => ( is => 'ro', isa => UUID ); +} + +lives_ok { + Class->new( uuid => '77C71F92-0EC7-11DD-B986-DF138EE79F6F' ); +} 'valid UUID works'; + +throws_ok { + Class->new( uuid => 'there is no way you could possibly think this is a UUID' ); +} qr/does not pass the type constraint/;