Convert all tests to done_testing.
[gitmo/Moose.git] / t / 060_compat / 002_moose_respects_base.t
CommitLineData
7eaef7ad 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
a28e50e4 6use Test::More;
7eaef7ad 7use Test::Exception;
8
7ff56534 9
bbd2fe69 10=pod
11
d03bd989 12This test demonstrates that Moose will respect
13a previously set @ISA using use base, and not
14try to add Moose::Object to it.
bbd2fe69 15
d03bd989 16However, this is extremely order sensitive as
bbd2fe69 17this test also demonstrates.
18
19=cut
20
7eaef7ad 21{
22 package Foo;
23 use strict;
24 use warnings;
d03bd989 25
7eaef7ad 26 sub foo { 'Foo::foo' }
d03bd989 27
28 package Bar;
7eaef7ad 29 use base 'Foo';
bbd2fe69 30 use Moose;
d03bd989 31
32 sub new { (shift)->meta->new_object(@_) }
33
bbd2fe69 34 package Baz;
d03bd989 35 use Moose;
36 use base 'Foo';
7eaef7ad 37}
38
39my $bar = Bar->new;
40isa_ok($bar, 'Bar');
bbd2fe69 41isa_ok($bar, 'Foo');
42ok(!$bar->isa('Moose::Object'), '... Bar is not Moose::Object subclass');
43
44my $baz = Baz->new;
45isa_ok($baz, 'Baz');
46isa_ok($baz, 'Foo');
47isa_ok($baz, 'Moose::Object');
48
a28e50e4 49done_testing;