Changelogging
[gitmo/Mouse.git] / t / 060_compat / 002_moose_respects_base.t
CommitLineData
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!!!
4use t::lib::MooseCompat;
5
6use strict;
7use warnings;
8
9use Test::More;
10$TODO = q{Mouse is not yet completed};
11use Test::Exception;
12
13
14=pod
15
16This test demonstrates that Mouse will respect
17a previously set @ISA using use base, and not
18try to add Mouse::Object to it.
19
20However, this is extremely order sensitive as
21this 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
43my $bar = Bar->new;
44isa_ok($bar, 'Bar');
45isa_ok($bar, 'Foo');
46ok(!$bar->isa('Mouse::Object'), '... Bar is not Mouse::Object subclass');
47
48my $baz = Baz->new;
49isa_ok($baz, 'Baz');
50isa_ok($baz, 'Foo');
51isa_ok($baz, 'Mouse::Object');
52
53done_testing;