X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F200_examples%2F004_example_w_DCS.t;h=58cd3e7b73d4cfd5c0c4e9a0af0cd02f657f268b;hb=097778c4f3e8331bf7056821c974d8cbb513b6ba;hp=00e8dce45ad5278e5659d7be4215c5ea2110c90c;hpb=7a50b45027c9f7baad76cfce7f78c822bd38f0a7;p=gitmo%2FMouse.git diff --git a/t/200_examples/004_example_w_DCS.t b/t/200_examples/004_example_w_DCS.t index 00e8dce..58cd3e7 100644 --- a/t/200_examples/004_example_w_DCS.t +++ b/t/200_examples/004_example_w_DCS.t @@ -30,11 +30,12 @@ use Test::Exception; # define your own type ... type( 'HashOfArrayOfObjects', + { where => IsHashRef( -keys => HasLength, -values => IsArrayRef(IsObject) ) - ); + } ); has 'bar' => ( is => 'rw', @@ -44,7 +45,7 @@ use Test::Exception; # inline the constraints as anon-subtypes has 'baz' => ( is => 'rw', - isa => subtype( as => 'ArrayRef', where => IsArrayRef(IsInt) ), + isa => subtype( { as => 'ArrayRef', where => IsArrayRef(IsInt) } ), ); package Bar; @@ -82,7 +83,6 @@ dies_ok { $foo->bar({ foo => [ 1, 2, 3 ] }); } '... validation failed correctly'; - dies_ok { $foo->baz([ "foo" ]); } '... validation failed correctly'; @@ -90,3 +90,4 @@ dies_ok { dies_ok { $foo->baz({}); } '... validation failed correctly'; +