Your IP : 216.73.216.1


Current Path : /usr/share/doc/perl-Moose/t/attributes/
Upload File :
Current File : //usr/share/doc/perl-Moose/t/attributes/lazy_no_default.t

use strict;
use warnings;

use Test::More;
use Test::Fatal;

{
    package Foo;
    use Moose;

    ::like(
        ::exception{ has foo => (
                is   => 'ro',
                lazy => 1,
            );
            },
        qr/\QYou cannot have a lazy attribute (foo) without specifying a default value for it/,
        'lazy without a default or builder throws an error'
    );
}

done_testing;