X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F019-handles.t;h=9208a3c8fc6475922b293cc68fabf8ddca921c3d;hb=8cbcbb47d0f02077d07873c553494a884d9c085f;hp=47abf58a551e2d031eba8e987863c54ad7463a89;hpb=7b133c927969b2e9233a51c6be5caed54c88915e;p=gitmo%2FMouse.git diff --git a/t/019-handles.t b/t/019-handles.t index 47abf58..9208a3c 100644 --- a/t/019-handles.t +++ b/t/019-handles.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 26; +use Test::More tests => 28; use Test::Exception; do { @@ -118,13 +118,30 @@ is_deeply( "correct handles layout for 'person'", ); -throws_ok{ + +{ + local $TODO = "failed on some environment, but I don't know why it happens (gfx)"; + throws_ok{ + $object->person(undef); + $object->person_name(); + } qr/Cannot delegate person_name to name because the value of person is not defined/; + + throws_ok{ + $object->person([]); + $object->person_age(); + } qr/Cannot delegate person_age to age because the value of person is not an object/; +} + +eval{ $object->person(undef); $object->person_name(); -} qr/Cannot delegate person_name to name because the value of person is not defined/; +}; +like $@, qr/Cannot delegate person_name to name because the value of person is not defined/; -throws_ok{ +eval{ $object->person([]); $object->person_age(); -} qr/Cannot delegate person_age to age because the value of person is not an object/; +}; +like $@, qr/Cannot delegate person_age to age because the value of person is not an object/; +