5c8b6ea0a82c6c31dbe86054cd2afcefe68d86d8
[p5sagit/namespace-clean.git] / t / 04-except.t
1 #!/usr/bin/env perl
2 use warnings;
3 use strict;
4
5 use FindBin;
6 use lib "$FindBin::Bin/lib";
7 use Test::More tests => 6;
8
9 {   package ExceptWithArray;
10     use ExporterTest qw( foo bar qux );
11     use namespace::clean -except => [qw( foo bar )];
12 }
13 ok( ExceptWithArray->can('foo'),    'first of except list still there');
14 ok( ExceptWithArray->can('bar'),    'second of except list still there');
15 ok(!ExceptWithArray->can('qux'),    'item not in except list was removed');
16
17 {   package ExceptWithSingle;
18     use ExporterTest qw( foo bar qux );
19     use namespace::clean -except => 'qux';
20 }
21 ok(!ExceptWithSingle->can('foo'),   'first item not in except still there');
22 ok(!ExceptWithSingle->can('bar'),   'second item not in except still there');
23 ok( ExceptWithSingle->can('qux'),   'except item was removed');
24
25