misc junk
[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 => 27;
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     method
19 );
20
21 my @moose_not_unimported = qw(
22     super inner self
23 );
24
25 {
26     package Foo;
27 }
28
29 eval q{
30     package Foo;
31     use Moose;
32 };
33 ok(!$@, '... Moose succesfully exported into Foo');
34
35 can_ok('Foo', $_) for @moose_exports;
36 can_ok('Foo', $_) for @moose_not_unimported;
37
38 eval q{
39     package Foo;
40     no Moose;
41 };
42 ok(!$@, '... Moose succesfully un-exported from Foo');
43
44 ok(!Foo->can($_), '... Foo can no longer do ' . $_) for @moose_exports;
45 can_ok('Foo', $_) for @moose_not_unimported;
46