Commit | Line | Data |
fde8e43f |
1 | #!/usr/bin/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 | |
6 | use strict; |
7 | use warnings; |
8 | |
9 | use Test::More; |
10 | $TODO = q{Mouse is not yet completed}; |
11 | use Test::Exception; |
12 | |
13 | |
14 | =pod |
15 | |
16 | This test demonstrates that Mouse will respect |
17 | a previously set @ISA using use base, and not |
18 | try to add Mouse::Object to it. |
19 | |
20 | However, this is extremely order sensitive as |
21 | this test also demonstrates. |
22 | |
23 | =cut |
24 | |
25 | { |
26 | package Foo; |
27 | use strict; |
28 | use warnings; |
29 | |
30 | sub foo { 'Foo::foo' } |
31 | |
32 | package Bar; |
33 | use base 'Foo'; |
34 | use Mouse; |
35 | |
36 | sub new { (shift)->meta->new_object(@_) } |
37 | |
38 | package Baz; |
39 | use Mouse; |
40 | use base 'Foo'; |
41 | } |
42 | |
43 | my $bar = Bar->new; |
44 | isa_ok($bar, 'Bar'); |
45 | isa_ok($bar, 'Foo'); |
46 | ok(!$bar->isa('Mouse::Object'), '... Bar is not Mouse::Object subclass'); |
47 | |
48 | my $baz = Baz->new; |
49 | isa_ok($baz, 'Baz'); |
50 | isa_ok($baz, 'Foo'); |
51 | isa_ok($baz, 'Mouse::Object'); |
52 | |
53 | done_testing; |