1 ## This test ensures that sub DEMOLISHALL fires even if there is no sub DEMOLISH
2 ## Currently fails because of a bad optimization in DESTROY
3 ## Feb 12, 2009 -- Evan Carroll me@evancarroll.com
4 package Role::DemolishAll;
9 after 'DEMOLISHALL' => sub { $Role::DemolishAll::ok++ };
11 package DemolishAll::WithoutDemolish;
13 with 'Role::DemolishAll';
15 package DemolishAll::WithDemolish;
17 with 'Role::DemolishAll';
24 my $m = DemolishAll::WithDemolish->new;
26 is ( $Role::DemolishAll::ok, 1, 'DemolishAll w/ explicit DEMOLISH sub' );
28 $m = DemolishAll::WithoutDemolish->new;
30 is ( $Role::DemolishAll::ok, 1, 'DemolishAll wo/ explicit DEMOLISH sub' );