Bumping version to 0.006022
[p5sagit/Devel-Declare.git] / t / method-no-semi.t
index 731584f..1bcfd2a 100644 (file)
@@ -1,11 +1,13 @@
+use strict;
+use warnings;
 use Devel::Declare ();
-use Scope::Guard;
 
 {
   package MethodHandlers;
 
   use strict;
   use warnings;
+  use B::Hooks::EndOfScope;
 
   our ($Declarator, $Offset);
 
@@ -100,13 +102,12 @@ use Scope::Guard;
   }
 
   sub inject_scope {
-    $^H |= 0x120000;
-    $^H{DD_METHODHANDLERS} = Scope::Guard->new(sub {
+    on_scope_end {
       my $linestr = Devel::Declare::get_linestr;
       my $offset = Devel::Declare::get_linestr_offset;
       substr($linestr, $offset, 0) = ';';
       Devel::Declare::set_linestr($linestr);
-    });
+    };
   }
 }
 
@@ -155,7 +156,7 @@ my ($test_method1, $test_method2, @test_list);
 
 }
 
-use Test::More 'no_plan';
+use Test::More 0.88;
 
 my $o = DeclareTest->new(attr => "value");
 
@@ -178,3 +179,5 @@ is($o->$test_method1('no', 'yes'), 'value, yes', 'anon method with @_ ok');
 is($o->$test_method2('this'), 'DeclareTest2, this', 'anon method with proto ok');
 
 is_deeply([ map { $_->() } @test_list ], [ 1, 2, 3, 4], 'binding ok');
+
+done_testing;