Regenerate test files
[gitmo/Mouse.git] / t-failing / 050_metaclasses / 003_moose_w_metaclass.t
CommitLineData
41888e7d 1#!/usr/bin/perl
fde8e43f 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;
41888e7d 5
6use strict;
7use warnings;
8
fde8e43f 9use Test::More;
10$TODO = q{Mouse is not yet completed};
41888e7d 11use Test::Exception;
12
13
41888e7d 14=pod
15
16This test demonstrates that Mouse will respect
17a metaclass previously set with the metaclass
18pragma.
19
20It also checks an error condition where that
21metaclass must be a Mouse::Meta::Class subclass
22in order to work.
23
24=cut
25
26
27{
28 package Foo::Meta;
29 use strict;
30 use warnings;
31
32 use base 'Mouse::Meta::Class';
33
34 package Foo;
35 use strict;
36 use warnings;
37 use metaclass 'Foo::Meta';
38 ::use_ok('Mouse');
39}
40
41isa_ok(Foo->meta, 'Foo::Meta');
42
43{
44 package Bar::Meta;
45 use strict;
46 use warnings;
47
fde8e43f 48 use base 'Mouse::Meta::Class';
41888e7d 49
50 package Bar;
51 use strict;
52 use warnings;
53 use metaclass 'Bar::Meta';
54 eval 'use Mouse;';
55 ::ok($@, '... could not load moose without correct metaclass');
56 ::like($@,
57 qr/^Bar already has a metaclass, but it does not inherit Mouse::Meta::Class/,
58 '... got the right error too');
59}
fde8e43f 60
61done_testing;