changelog
[gitmo/Package-Stash.git] / t / stash-deletion.t
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 use lib 't/lib';
5 use Test::More;
6
7 use Package::Stash;
8
9 {
10     package Gets::Deleted;
11     sub bar { }
12 }
13
14 {
15     my $delete = Package::Stash->new('Gets::Deleted');
16     ok($delete->has_symbol('&bar'), "sees the method");
17     {
18         no strict 'refs';
19         delete ${'main::Gets::'}{'Deleted::'};
20     }
21     ok(!$delete->has_symbol('&bar'), "method goes away when stash is deleted");
22 }
23
24 done_testing;