Regenerate test files
[gitmo/Mouse.git] / t / 100_bugs / 021_DEMOLISHALL_shortcutted.t
CommitLineData
fde8e43f 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!!!
4use t::lib::MooseCompat;
5## Currently fails because of a bad optimization in DESTROY
6## Feb 12, 2009 -- Evan Carroll me@evancarroll.com
7package Role::DemolishAll;
8use Mouse::Role;
9our $ok = 0;
10
11sub BUILD { $ok = 0 };
12after 'DEMOLISHALL' => sub { $Role::DemolishAll::ok++ };
13
14package DemolishAll::WithoutDemolish;
15use Mouse;
16with 'Role::DemolishAll';
17
18package DemolishAll::WithDemolish;
19use Mouse;
20with 'Role::DemolishAll';
21sub DEMOLISH {};
22
23
24package main;
25use Test::More;
26$TODO = q{Mouse is not yet completed};
27
28my $m = DemolishAll::WithDemolish->new;
29undef $m;
30is ( $Role::DemolishAll::ok, 1, 'DemolishAll w/ explicit DEMOLISH sub' );
31
32$m = DemolishAll::WithoutDemolish->new;
33undef $m;
34is ( $Role::DemolishAll::ok, 1, 'DemolishAll wo/ explicit DEMOLISH sub' );
35
36done_testing;