X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F030-has-plus.t;h=34b8ec4637e154d7879485b10b4365f4e13cf1af;hb=8a3e5c5d45741e488e89d5130b5dcb44f2c6a6f4;hp=7706f4a71ae80653082f19309a5cdac28ce10359;hpb=7e2909e58c70dfb258ca1d10b334eaa6d8422852;p=gitmo%2FMouse.git diff --git a/t/030-has-plus.t b/t/030-has-plus.t index 7706f4a..34b8ec4 100644 --- a/t/030-has-plus.t +++ b/t/030-has-plus.t @@ -1,7 +1,8 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 3; +use Test::Exception; do { package Class; @@ -27,3 +28,15 @@ ok(!$obj->attr, 'has + does not affect the superclass'); my $obj2 = Child->new; ok($obj2->attr, 'has + combines child attribute with parent'); +do { + package Child2; + use Mouse; + extends 'Class'; + + ::throws_ok { + has '+nonexistent' => ( + is => 'rw', + ); + } qr/Could not find an attribute by the name of 'nonexistent' to inherit from/; +}; +