6 use Test::More tests => 5;
22 # Defining this causes the FIRST call to Baz->new w/o param to fail,
23 # if no call to ANY Moose::Object->new was done before.
26 # ... Moose (kinda) eats exceptions in DESTROY/DEMOLISH";
31 my $obj = eval { Foo->new; };
32 ::like( $@, qr/is required/, "... Foo plain" );
33 ::is( $obj, undef, "... the object is undef" );
39 sub new { die "Bar died"; }
42 die "Vanilla Perl eats exceptions in DESTROY too";
47 my $obj = eval { Bar->new; };
48 ::like( $@, qr/Bar died/, "... Bar plain" );
49 ::is( $obj, undef, "... the object is undef" );