6 use Test::More tests => 4;
20 # Defining this causes the FIRST call to Baz->new w/o param to fail,
21 # if no call to ANY Moose::Object->new was done before.
24 # ... Moose (kinda) eats exceptions in DESTROY/DEMOLISH";
29 my $obj = eval { Foo->new; };
30 ::like( $@, qr/is required/, "... Foo plain" );
31 ::is( $obj, undef, "... the object is undef" );
37 sub new { die "Bar died"; }
40 die "Vanilla Perl eats exceptions in DESTROY too";
45 my $obj = eval { Bar->new; };
46 ::like( $@, qr/Bar died/, "... Bar plain" );
47 ::is( $obj, undef, "... the object is undef" );