From: Shawn M Moore Date: Fri, 27 Jun 2008 03:41:05 +0000 (+0000) Subject: Ensure that "has '+nonexistent'" fails X-Git-Tag: 0.19~272 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=a02698f11a62bdf881c1a00651c2426b95095b29 Ensure that "has '+nonexistent'" fails --- 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/; +}; +