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