New testing feature that allows specification of the workdir for the tests
[dbsrgits/DBM-Deep.git] / t / 22_internal_copy.t
index 699f6c0..c2ed42a 100644 (file)
@@ -3,14 +3,11 @@
 ##
 use strict;
 use Test::More tests => 13;
-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 ($fh, $filename) = tempfile( 'tmpXXXX', UNLINK => 1, DIR => $dir );
-flock $fh, LOCK_UN;
+my ($fh, $filename) = new_fh();
 my $db = DBM::Deep->new( $filename );
 
 ##
@@ -51,8 +48,7 @@ is( $db->{copy}{subkey3}, 'subvalue3', "After the second copy, we're still good"
 
 my $max_keys = 1000;
 
-my ($fh2, $filename2) = tempfile( 'tmpXXXX', UNLINK => 1, DIR => $dir );
-flock $fh2, LOCK_UN;
+my ($fh2, $filename2) = new_fh();
 {
     my $db = DBM::Deep->new( $filename2 );