From: Graham Knop Date: Mon, 24 Jun 2013 04:47:58 +0000 (-0400) Subject: test for required+builder X-Git-Tag: v1.003000~34 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=60cc0a5abbad6a2053e809c483514da3bb7032ad;p=gitmo%2FMoo.git test for required+builder --- diff --git a/t/accessor-default.t b/t/accessor-default.t index fd50924..d326dd5 100644 --- a/t/accessor-default.t +++ b/t/accessor-default.t @@ -26,6 +26,8 @@ my $c_ran; has eleven => (is => 'ro', default => 5 ); has twelve => (is => 'lazy', default => 0 ); has thirteen => (is => 'ro', default => 0 ); + has fourteen => (is => 'ro', required => 1, builder => '_build_fourteen'); + sub _build_fourteen { {} } } sub check { @@ -50,6 +52,8 @@ check six => map Foo->new->{six}, 1..2; check seven => map Foo->new->{seven}, 1..2; +check fourteen => map Foo->new->{fourteen}, 1..2; + check eight => map Foo->new->{eight}, 1..2; ok($c_ran, 'coerce defaults');