X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faccessor-default.t;fp=t%2Faccessor-default.t;h=d326dd5fd1869b11ee3f43df6c10f8d43801cb15;hb=60cc0a5abbad6a2053e809c483514da3bb7032ad;hp=fd50924ba98b2d31668eefee119c4eeca2ee470d;hpb=5d09ae9323f64822da6f6b0ffa5c212b4e34ab74;p=gitmo%2FMoo.git 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');