10 my $isa = sub { die "I want to die" unless $_[0] eq 'live' };
16 builder => '_build_attr',
22 builder => '_build_attr',
25 sub _build_attr { 'die' }
28 ok my $lives = FooISA->new(a_lazy_attr=>'live', non_lazy=>'live'),
29 'expect to live when both attrs are set to live in init';
32 exception { FooISA->new(a_lazy_attr=>'live', non_lazy=>'die') },
34 'expect to die when non lazy is set to die in init',
38 exception { FooISA->new(a_lazy_attr=>'die', non_lazy=>'die') },
40 'expect to die when non lazy and lazy is set to die in init',
44 exception { FooISA->new(a_lazy_attr=>'die', non_lazy=>'live') },
46 'expect to die when lazy is set to die in init',
50 exception { FooISA->new() },
52 'expect to die when both lazy and non lazy are allowed to default',
56 exception { FooISA->new(a_lazy_attr=>'live') },
58 'expect to die when lazy is set to live but non lazy is allowed to default',
62 exception { FooISA->new(non_lazy=>'live') },
64 'ok when non lazy is set to something valid but lazy is allowed to default',