Regenerate test files
[gitmo/Mouse.git] / t / 100_bugs / 014_DEMOLISHALL.t
1 #!/usr/bin/env perl
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 use strict;
6 use warnings;
7 use Test::More;
8 $TODO = q{Mouse is not yet completed};
9
10 my @called;
11
12 do {
13     package Class;
14     use Mouse;
15
16     sub DEMOLISH {
17         push @called, 'Class::DEMOLISH';
18     }
19
20     sub DEMOLISHALL {
21         my $self = shift;
22         push @called, 'Class::DEMOLISHALL';
23         $self->SUPER::DEMOLISHALL(@_);
24     }
25
26     package Child;
27     use Mouse;
28     extends 'Class';
29
30     sub DEMOLISH {
31         push @called, 'Child::DEMOLISH';
32     }
33
34     sub DEMOLISHALL {
35         my $self = shift;
36         push @called, 'Child::DEMOLISHALL';
37         $self->SUPER::DEMOLISHALL(@_);
38     }
39 };
40
41 is_deeply([splice @called], [], "no DEMOLISH calls yet");
42
43 do {
44     my $object = Class->new;
45
46     is_deeply([splice @called], [], "no DEMOLISH calls yet");
47 };
48
49 is_deeply([splice @called], ['Class::DEMOLISHALL', 'Class::DEMOLISH']);
50
51 do {
52     my $child = Child->new;
53     is_deeply([splice @called], [], "no DEMOLISH calls yet");
54
55 };
56
57 is_deeply([splice @called], ['Child::DEMOLISHALL', 'Class::DEMOLISHALL', 'Child::DEMOLISH', 'Class::DEMOLISH']);
58
59 done_testing;