X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F019-handles.t;h=03797d639c3ee84f0de0285cf034432f61835eeb;hb=08f7a8dbc5e48fcece4396a500d37bb2c6e45b74;hp=6d265be1112d8c4eb2e0837d2e130cae44388058;hpb=c3398f5bd45f2851b7cd40ca9823bcf7d2378469;p=gitmo%2FMouse.git diff --git a/t/019-handles.t b/t/019-handles.t index 6d265be..03797d6 100644 --- a/t/019-handles.t +++ b/t/019-handles.t @@ -2,7 +2,6 @@ use strict; use warnings; use Test::More tests => 24; -use Test::Exception; do { package Person; @@ -38,29 +37,45 @@ do { handles => [qw/name age/], ); - ::throws_ok { - has error => ( - handles => "string", - ); - } qr/You must pass a HASH or ARRAY to handles/; - - ::throws_ok { - has error2 => ( - handles => \"ref_to_string", - ); - } qr/You must pass a HASH or ARRAY to handles/; - - ::throws_ok { - has error3 => ( - handles => qr/regex/, - ); - } qr/You must pass a HASH or ARRAY to handles/; - - ::throws_ok { - has error4 => ( - handles => sub { "code" }, - ); - } qr/You must pass a HASH or ARRAY to handles/; + TODO: { + local our $TODO = "Mouse lacks this"; + eval { + has error => ( + handles => "string", + ); + }; + ::ok(!$@, "handles => role"); + } + + TODO: { + local our $TODO = "Mouse lacks this"; + eval { + has error2 => ( + handles => \"ref_to_string", + ); + }; + ::ok(!$@, "handles => \\str"); + } + + TODO: { + local our $TODO = "Mouse lacks this"; + eval { + has error3 => ( + handles => qr/regex/, + ); + }; + ::ok(!$@, "handles => qr/re/"); + } + + TODO: { + local our $TODO = "Mouse lacks this"; + eval { + has error4 => ( + handles => sub { "code" }, + ); + }; + ::ok(!$@, "handles => sub { code }"); + } }; can_ok(Class => qw(person has_person person_name person_age name age quid)); @@ -92,7 +107,7 @@ is($object->me->age, 21, "me->age"); is_deeply( $object->meta->get_attribute('me')->handles, - { name => 'name', age => 'age' }, + [ 'name', 'age' ], "correct handles layout for 'me'", );