12 init_arg => 'might_have',
13 isa => sub { die "isa" if $_[0] % 2 },
19 init_arg => 'workshy',
20 isa => sub { die "aieee" if $_[0] % 2 },
27 exception { Foo->new },
28 qr/\Aisa check for "optional" \(constructor argument: "might_have"\) failed:/,
33 exception { Foo->new(might_have => 3) },
34 qr/\Aisa check for "optional" \(constructor argument: "might_have"\) failed:/,
39 exception { Foo->new(might_have => 2) },
40 undef, "isa init_arg ok"
43 my $foo = Foo->new(might_have => 2);
46 exception { $foo->optional(3) },
47 qr/\Aisa check for "optional" failed:/,
52 exception { $foo->lazy },
53 qr/\Aisa check for "lazy" failed:/,
58 exception { $foo->lazy(3) },
59 qr/\Aisa check for "lazy" failed:/,
64 exception { $foo->lazy(4) },
70 exception { Foo->new(might_have => 2, workshy => 3) },
71 qr/\Aisa check for "lazy" \(constructor argument: "workshy"\) failed:/,