this is broken, we need to fix it
[gitmo/Moose.git] / t / 018_import_unimport.t
CommitLineData
31f8ec72 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
2a0f3bd3 6use Test::More tests => 23;
31f8ec72 7
8BEGIN {
9 use_ok('Moose');
10}
11
12my @moose_exports = qw(
13 extends with
14 has
15 before after around
3279ab4a 16 override
17 augment
3279ab4a 18);
19
20my @moose_not_unimported = qw(
2a0f3bd3 21 super inner
31f8ec72 22);
23
24{
25 package Foo;
26}
27
28eval q{
29 package Foo;
30 use Moose;
31};
32ok(!$@, '... Moose succesfully exported into Foo');
33
34can_ok('Foo', $_) for @moose_exports;
3279ab4a 35can_ok('Foo', $_) for @moose_not_unimported;
31f8ec72 36
37eval q{
38 package Foo;
39 no Moose;
40};
41ok(!$@, '... Moose succesfully un-exported from Foo');
42
3279ab4a 43ok(!Foo->can($_), '... Foo can no longer do ' . $_) for @moose_exports;
44can_ok('Foo', $_) for @moose_not_unimported;
45