1 ## This test ensures that sub DEMOLISHALL fires even if there is no sub DEMOLISH
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;
5 ## Currently fails because of a bad optimization in DESTROY
6 ## Feb 12, 2009 -- Evan Carroll me@evancarroll.com
7 package Role::DemolishAll;
11 sub BUILD { $ok = 0 };
12 after 'DEMOLISHALL' => sub { $Role::DemolishAll::ok++ };
14 package DemolishAll::WithoutDemolish;
16 with 'Role::DemolishAll';
18 package DemolishAll::WithDemolish;
20 with 'Role::DemolishAll';
26 $TODO = q{Mouse is not yet completed};
28 my $m = DemolishAll::WithDemolish->new;
30 is ( $Role::DemolishAll::ok, 1, 'DemolishAll w/ explicit DEMOLISH sub' );
32 $m = DemolishAll::WithoutDemolish->new;
34 is ( $Role::DemolishAll::ok, 1, 'DemolishAll wo/ explicit DEMOLISH sub' );