From: Graham Knop Date: Mon, 24 Jun 2013 03:07:48 +0000 (-0400) Subject: test generating bare attributes X-Git-Tag: v1.003000~36 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c0b8e1a13cf047cbb9ca6fccd9dd22d0a661d8d6;p=gitmo%2FMoo.git test generating bare attributes --- diff --git a/t/method-generate-accessor.t b/t/method-generate-accessor.t index 87d2508..118ff47 100644 --- a/t/method-generate-accessor.t +++ b/t/method-generate-accessor.t @@ -32,6 +32,12 @@ like( qr/Unknown is purple/, 'is purple rejected' ); +is(exception { + $gen->generate_method('Foo' => 'three' => { is => 'bare', predicate => 1 }); +}, undef, 'generating bare accessor works'); + +ok(Foo->can('has_three'), 'bare accessor will still generate predicate'); + like( exception { $gen->generate_method('Foo' => 'four' => { is => 'ro', coerce => 5 }) }, qr/Invalid coerce/, "coerce - scalar rejected"