Benchmark-DKbench

 view release on metacpan or  search on metacpan

data/t/attributes/misc_attribute_coerce_lazy.t  view on Meta::CPAN

        => from 'ArrayRef'
            => via { HTTPHeader->new(array => $_[0]) }
        => from 'HashRef'
            => via { HTTPHeader->new(hash => $_[0]) };

    has 'headers'  => (
        is      => 'rw',
        isa     => 'Header',
        coerce  => 1,
        lazy    => 1,
        default => sub { [ 'content-type', 'text/html' ] }
    );
}

my $r = Request->new;
isa_ok($r, 'Request');

is( exception {
    $r->headers;
}, undef, '... this coerces and passes the type constraint even with lazy' );



( run in 2.556 seconds using v1.01-cache-2.11-cpan-524268b4103 )