Changelogging
[gitmo/Mouse.git] / t / 010_basics / 009_import_unimport.t
CommitLineData
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!!!
4use t::lib::MooseCompat;
60ad2cb7 5
6use strict;
7use warnings;
8
fde8e43f 9use Test::More;
10$TODO = q{Mouse is not yet completed};
60ad2cb7 11
12
13my @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
30can_ok('Foo', $_) for @moose_exports;
31
32{
33 package Foo;
34
35 eval 'no Mouse';
36 die $@ if $@;
37}
38
39ok(!Foo->can($_), '... Foo can no longer do ' . $_) for @moose_exports;
40
41# and check the type constraints as well
42
43my @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
57can_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 66ok(!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
78can_ok( 'Baz', 'blessed' );
79
80done_testing;