stop depending on Scope::Guard just for tests
[p5sagit/Devel-GlobalDestruction.git] / t / basic.t
index 27157c7..111dff1 100644 (file)
--- a/t/basic.t
+++ b/t/basic.t
@@ -7,7 +7,11 @@ use warnings;
 # use Test::More tests => 3;
 # use ok 'Devel::GlobalDestruction';
 
-use Scope::Guard;
+BEGIN {
+    package Test::Scope::Guard;
+    sub new { my ($class, $code) = @_; bless [$code], $class; }
+    sub DESTROY { my $self = shift; $self->[0]->() }
+}
 
 print "1..4\n";
 
@@ -24,6 +28,6 @@ ok( defined &in_global_destruction, "exported" );
 
 ok( !in_global_destruction(), "not in GD" );
 
-our $sg = Scope::Guard->new(sub { ok( in_global_destruction(), "in GD" ) });
+our $sg = Test::Scope::Guard->new(sub { ok( in_global_destruction(), "in GD" ) });