summaryrefslogtreecommitdiffstats
path: root/t/stash-deletion.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-08-05 14:41:11 -0500
committerJesse Luehrs <doy@tozt.net>2011-08-05 14:41:11 -0500
commitaa9c54a31b72a6cc7bdce3efcc27dd010e593564 (patch)
tree804d931b024dd4d09c454b016909976c396dfbaf /t/stash-deletion.t
parentd173d3a338b6b69f9d84006f05fc50c95193919a (diff)
downloadpackage-stash-aa9c54a31b72a6cc7bdce3efcc27dd010e593564.tar.gz
package-stash-aa9c54a31b72a6cc7bdce3efcc27dd010e593564.zip
refactor tests a bit
Diffstat (limited to 't/stash-deletion.t')
-rw-r--r--t/stash-deletion.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/stash-deletion.t b/t/stash-deletion.t
new file mode 100644
index 0000000..e331234
--- /dev/null
+++ b/t/stash-deletion.t
@@ -0,0 +1,24 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use lib 't/lib';
+use Test::More;
+
+use Package::Stash;
+
+{
+ package Gets::Deleted;
+ sub bar { }
+}
+
+{
+ my $delete = Package::Stash->new('Gets::Deleted');
+ ok($delete->has_symbol('&bar'), "sees the method");
+ {
+ no strict 'refs';
+ delete ${'main::Gets::'}{'Deleted::'};
+ }
+ ok(!$delete->has_symbol('&bar'), "method goes away when stash is deleted");
+}
+
+done_testing;