Commit | Line | Data |
60ad2cb7 |
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!!! |
4 | use t::lib::MooseCompat; |
60ad2cb7 |
5 | |
6 | use strict; |
7 | use warnings; |
8 | |
fde8e43f |
9 | use Test::More; |
10 | $TODO = q{Mouse is not yet completed}; |
60ad2cb7 |
11 | |
12 | |
13 | my @moose_exports = qw( |
14 | extends with |
15 | has |
16 | before after around |
17 | override |
18 | augment |
19 | super inner |
fde8e43f |
20 | blessed confess |
60ad2cb7 |
21 | ); |
22 | |
23 | { |
24 | package Foo; |
25 | |
26 | eval 'use Mouse'; |
27 | die $@ if $@; |
28 | } |
29 | |
30 | can_ok('Foo', $_) for @moose_exports; |
31 | |
32 | { |
33 | package Foo; |
34 | |
35 | eval 'no Mouse'; |
36 | die $@ if $@; |
37 | } |
38 | |
39 | ok(!Foo->can($_), '... Foo can no longer do ' . $_) for @moose_exports; |
40 | |
41 | # and check the type constraints as well |
42 | |
43 | my @moose_type_constraint_exports = qw( |
44 | type subtype as where message |
45 | coerce from via |
46 | enum |
47 | find_type_constraint |
48 | ); |
49 | |
50 | { |
51 | package Bar; |
52 | |
53 | eval 'use Mouse::Util::TypeConstraints'; |
54 | die $@ if $@; |
55 | } |
56 | |
57 | can_ok('Bar', $_) for @moose_type_constraint_exports; |
58 | |
59 | { |
60 | package Bar; |
61 | |
62 | eval 'no Mouse::Util::TypeConstraints'; |
63 | die $@ if $@; |
64 | } |
65 | |
8a3e5c5d |
66 | ok(!Bar->can($_), '... Bar can no longer do ' . $_) for @moose_type_constraint_exports; |
60ad2cb7 |
67 | |
60ad2cb7 |
68 | |
fde8e43f |
69 | { |
70 | package Baz; |
71 | |
72 | use Mouse; |
73 | use Scalar::Util qw( blessed ); |
74 | |
75 | no Mouse; |
76 | } |
77 | |
78 | can_ok( 'Baz', 'blessed' ); |
79 | |
80 | done_testing; |