X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F019-handles.t;h=03797d639c3ee84f0de0285cf034432f61835eeb;hb=08f7a8dbc5e48fcece4396a500d37bb2c6e45b74;hp=7911f3c9e121c2a7006161b18eef683fc35bd679;hpb=3118622d182add6c88792d5de3b4af047e8a7c8c;p=gitmo%2FMouse.git diff --git a/t/019-handles.t b/t/019-handles.t index 7911f3c..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 t::Exception; do { package Person; @@ -38,29 +37,45 @@ do { handles => [qw/name age/], ); - ::throws_ok { - has error => ( - handles => "string", - ); - } qr/Unable to canonicalize the 'handles' option with string/; - - ::throws_ok { - has error2 => ( - handles => \"ref_to_string", - ); - } qr/Unable to canonicalize the 'handles' option with SCALAR\(\w+\)/; - - ::throws_ok { - has error3 => ( - handles => qr/regex/, - ); - } qr/Unable to canonicalize the 'handles' option with \(\?-xism:regex\)/; - - ::throws_ok { - has error4 => ( - handles => sub { "code" }, - ); - } qr/Unable to canonicalize the 'handles' option with CODE\(\w+\)/; + 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));