From: Jesse Luehrs Date: Sun, 3 Jul 2011 00:21:52 +0000 (-0500) Subject: stop depending on Scope::Guard just for tests X-Git-Tag: Devel-GlobalDestruction-0.04~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=38d57e492a75b5231d27be8c67429bd5fc145a9d;p=p5sagit%2FDevel-GlobalDestruction.git stop depending on Scope::Guard just for tests --- diff --git a/Makefile.PL b/Makefile.PL index 646fbab..34baa98 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -14,7 +14,6 @@ WriteMakefile( MIN_PERL_VERSION => '5.006000', PREREQ_PM => { 'Sub::Exporter' => 0, - 'Scope::Guard' => 0, }, (defined ${^GLOBAL_PHASE} ? (XS => {}, C => []) : ()), ); diff --git a/t/basic.t b/t/basic.t index 27157c7..111dff1 100644 --- 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" ) });