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