X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F026-auto-deref.t;h=d4b1df512bbc8c0872878fef131ddde824bc31b0;hb=c9313657717f78bd96f0325c6aa1c93d0b0d41a5;hp=0edffeda456de15eac6bb7f6933db1f56c43a4ae;hpb=3cf68001150c7fa1e0f75dca6526a8507a0ae210;p=gitmo%2FMouse.git diff --git a/t/026-auto-deref.t b/t/026-auto-deref.t index 0edffed..d4b1df5 100644 --- a/t/026-auto-deref.t +++ b/t/026-auto-deref.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 13; +use Test::More tests => 15; use Test::Exception; do { @@ -19,6 +19,21 @@ do { isa => 'HashRef', auto_deref => 1, ); + + ::throws_ok { + has any => ( + is => 'rw', + auto_deref => 1, + ); + } qr/You cannot auto-dereference without specifying a type constraint on attribute \(any\)/; + + ::throws_ok { + has scalar => ( + is => 'rw', + isa => 'Value', + auto_deref => 1, + ); + } qr/You cannot auto-dereference anything other than a ArrayRef or HashRef on attribute \(scalar\)/; }; my $obj;