2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
18 has 'foo' => (is => 'rw', isa => 'Maybe[Str]', trigger => sub {
19 die "Pulling the Foo trigger\n"
22 has 'bar' => (is => 'rw', isa => 'Maybe[Str]');
24 has 'baz' => (is => 'rw', isa => 'Maybe[Str]', trigger => sub {
25 die "Pulling the Baz trigger\n"
28 __PACKAGE__->meta->make_immutable; #(debug => 1);
33 eval { AClass->new(foo => 'bar') };
34 like ($@, qr/^Pulling the Foo trigger/, "trigger from immutable constructor");
36 eval { AClass->new(baz => 'bar') };
37 like ($@, qr/^Pulling the Baz trigger/, "trigger from immutable constructor");
39 lives_ok { AClass->new(bar => 'bar') } '... no triggers called';