13 die "I want to die" unless $_[0] eq 'live';
20 builder => '_build_attr',
26 builder => '_build_attr',
29 sub _build_attr { 'die' }
32 ok my $lives = FooISA->new(a_lazy_attr=>'live', non_lazy=>'live'),
33 'expect to live when both attrs are set to live in init';
35 my $called_pre = $isa_called;
37 is $called_pre, $isa_called, 'isa is not called on access when value already exists';
40 exception { FooISA->new(a_lazy_attr=>'live', non_lazy=>'die') },
42 'expect to die when non lazy is set to die in init',
46 exception { FooISA->new(a_lazy_attr=>'die', non_lazy=>'die') },
48 'expect to die when non lazy and lazy is set to die in init',
52 exception { FooISA->new(a_lazy_attr=>'die', non_lazy=>'live') },
54 'expect to die when lazy is set to die in init',
58 exception { FooISA->new() },
60 'expect to die when both lazy and non lazy are allowed to default',
64 exception { FooISA->new(a_lazy_attr=>'live') },
66 'expect to die when lazy is set to live but non lazy is allowed to default',
70 exception { FooISA->new(non_lazy=>'live') },
72 'ok when non lazy is set to something valid but lazy is allowed to default',