Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 300_immutable / 005_multiple_demolish_inline.t
CommitLineData
1ca8d984 1#!/usr/bin/perl
16504b15 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;
1ca8d984 5
6use strict;
7use warnings;
8
16504b15 9use Test::More;
1ca8d984 10use Test::Exception;
11
12
1ca8d984 13{
14 package Foo;
15 use Mouse;
16
17 has 'foo' => (is => 'rw', isa => 'Int');
18
19 sub DEMOLISH { }
20}
21
22{
23 package Bar;
24 use Mouse;
25
26 extends qw(Foo);
27 has 'bar' => (is => 'rw', isa => 'Int');
28
29 sub DEMOLISH { }
30}
31
32lives_ok {
33 Bar->new();
34} 'Bar->new()';
35
36lives_ok {
37 Bar->meta->make_immutable;
38} 'Bar->meta->make_immutable';
39
40is( Bar->meta->get_method('DESTROY')->package_name, 'Bar',
41 'Bar has a DESTROY method in the Bar class (not inherited)' );
42
43lives_ok {
44 Foo->meta->make_immutable;
45} 'Foo->meta->make_immutable';
46
47is( Foo->meta->get_method('DESTROY')->package_name, 'Foo',
48 'Foo has a DESTROY method in the Bar class (not inherited)' );
16504b15 49
50done_testing;