one more spot still referring to compute_all_applicable_attributes
[gitmo/Class-MOP.git] / t / 041_metaclass_incompatibility.t
1 use strict;
2 use warnings;
3
4 use Test::More tests => 6;
5
6 BEGIN {use metaclass;    
7 }
8
9 # meta classes
10 {
11     package Foo::Meta;
12     use base 'Class::MOP::Class';
13     
14     package Bar::Meta;
15     use base 'Class::MOP::Class';
16     
17     package FooBar::Meta;
18     use base 'Foo::Meta', 'Bar::Meta';
19 }
20
21 $@ = undef;
22 eval {
23     package Foo;
24     metaclass->import('Foo::Meta');
25 };
26 ok(!$@, '... Foo.meta => Foo::Meta is compatible') || diag $@;
27
28 $@ = undef;
29 eval {
30     package Bar;
31     metaclass->import('Bar::Meta');
32 };
33 ok(!$@, '... Bar.meta => Bar::Meta is compatible') || diag $@;
34
35 $@ = undef;
36 eval {
37     package Foo::Foo;
38     use base 'Foo';
39     metaclass->import('Bar::Meta');
40 };
41 ok($@, '... Foo::Foo.meta => Bar::Meta is not compatible') || diag $@;
42
43 $@ = undef;
44 eval {
45     package Bar::Bar;
46     use base 'Bar';
47     metaclass->import('Foo::Meta');
48 };
49 ok($@, '... Bar::Bar.meta => Foo::Meta is not compatible') || diag $@;
50
51 $@ = undef;
52 eval {
53     package FooBar;
54     use base 'Foo';
55     metaclass->import('FooBar::Meta');
56 };
57 ok(!$@, '... FooBar.meta => FooBar::Meta is compatible') || diag $@;
58
59 $@ = undef;
60 eval {
61     package FooBar2;
62     use base 'Bar';
63     metaclass->import('FooBar::Meta');
64 };
65 ok(!$@, '... FooBar2.meta => FooBar::Meta is compatible') || diag $@;
66
67