New testing feature that allows specification of the workdir for the tests
[dbsrgits/DBM-Deep.git] / t / 13_setpack.t
index 603b6a0..f7c0e4d 100644 (file)
@@ -3,18 +3,14 @@
 ##
 use strict;
 use Test::More tests => 2;
-use File::Temp qw( tempfile tempdir );
-use Fcntl qw( :flock );
+use t::common qw( new_fh );
 
 use_ok( 'DBM::Deep' );
 
-my $dir = tempdir( CLEANUP => 1 );
-
 my ($before, $after);
 
 {
-    my ($fh, $filename) = tempfile( 'tmpXXXX', UNLINK => 1, DIR => $dir );
-    flock $fh, LOCK_UN;
+    my ($fh, $filename) = new_fh();
     my $db = DBM::Deep->new(
         file => $filename,
         autoflush => 1
@@ -25,8 +21,7 @@ my ($before, $after);
 }
 
 {
-    my ($fh, $filename) = tempfile( 'tmpXXXX', UNLINK => 1, DIR => $dir );
-    flock $fh, LOCK_UN;
+    my ($fh, $filename) = new_fh();
     my $db = DBM::Deep->new(
         file => $filename,
         autoflush => 1