Fix test description
[gitmo/Class-MOP.git] / t / 500_deprecated.t
CommitLineData
30229767 1use strict;
2use warnings;
3
4use Test::More tests => 4;
5use Test::Exception;
6
7use Carp;
8
9$SIG{__WARN__} = \&croak;
10
11{
12 package Foo;
13 use Test::More;
14 use Test::Exception;
15
16 throws_ok {
17 Class::MOP::in_global_destruction();
18 } qr/\b deprecated \b/xmsi, 'complained';
19}
20
21{
22 package Bar;
23 use Test::More;
24 use Test::Exception;
25
26 use Class::MOP::Deprecated -compatible => 0.93;
27
28 throws_ok {
29 Class::MOP::in_global_destruction();
30 } qr/\b deprecated \b/xmsi, 'complained';
31}
32
33{
34 package Baz;
35 use Test::More;
36 use Test::Exception;
37
38 use Class::MOP::Deprecated -compatible => 0.92;
39
40 lives_ok {
41 Class::MOP::in_global_destruction();
42 } 'safe';
43}
44
45
46{
47 package Baz::Inner;
48 use Test::More;
49 use Test::Exception;
50
51 lives_ok {
52 Class::MOP::in_global_destruction();
53 } 'safe in an inner class';
54}
55