X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F007-attributes.t;h=4316e256cdc2524beb42c1e5e94e47bfaf92e864;hb=eab815459cfd4be951f1f44cd656e76169f7a1d6;hp=cf2b5a7365102b45a98529093f59e8889a4e40ca;hpb=c3398f5bd45f2851b7cd40ca9823bcf7d2378469;p=gitmo%2FMouse.git diff --git a/t/007-attributes.t b/t/007-attributes.t index cf2b5a7..4316e25 100644 --- a/t/007-attributes.t +++ b/t/007-attributes.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More tests => 10; +use Test::Exception; do { package Class; @@ -27,7 +28,11 @@ ok(!$object->can('x'), "No accessor is injected if 'is' has no value"); can_ok($object, 'y', 'z'); is($object->y, undef); -is($object->y(10), undef); + +throws_ok { + $object->y(10); +} qr/Cannot assign a value to a read-only accessor/; + is($object->y, undef); is($object->z, undef);