From: Shawn M Moore Date: Tue, 10 Jun 2008 02:58:11 +0000 (+0000) Subject: Moose compat: required error message tweak X-Git-Tag: 0.04~64 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=398327c34d5f6a94084b1dd6f7b439b771ef8b1b;p=gitmo%2FMouse.git Moose compat: required error message tweak --- diff --git a/lib/Mouse/Object.pm b/lib/Mouse/Object.pm index e870e78..64f2ce4 100644 --- a/lib/Mouse/Object.pm +++ b/lib/Mouse/Object.pm @@ -38,7 +38,7 @@ sub new { } else { if ($attribute->is_required) { - confess "Attribute '".$attribute->name."' is required"; + confess "Attribute (".$attribute->name.") is required"; } } } diff --git a/t/010-required.t b/t/010-required.t index 3a8be4c..161717c 100644 --- a/t/010-required.t +++ b/t/010-required.t @@ -30,7 +30,7 @@ do { ); }; -throws_ok { Class->new } qr/Attribute 'foo' is required/, "required attribute is required"; +throws_ok { Class->new } qr/Attribute \(foo\) is required/, "required attribute is required"; lives_ok { Class->new(foo => 5) } "foo is the only required but unfulfilled attribute"; lives_ok { Class->new(foo => 1, bar => 1, baz => 1, quux => 1) } "all attributes specified";