New testing feature that allows specification of the workdir for the tests
[dbsrgits/DBM-Deep.git] / t / 25_tie_return_value.t
index e14c319..33943f3 100644 (file)
@@ -1,18 +1,14 @@
 use strict;
 
 use Test::More tests => 5;
-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 );
-
 use Scalar::Util qw( reftype );
 
 {
-    my ($fh, $filename) = tempfile( 'tmpXXXX', UNLINK => 1, DIR => $dir );
-    flock $fh, LOCK_UN;
+    my ($fh, $filename) = new_fh();
 
     my %hash;
     my $obj = tie %hash, 'DBM::Deep', $filename;
@@ -21,8 +17,7 @@ use Scalar::Util qw( reftype );
 }
 
 {
-    my ($fh, $filename) = tempfile( 'tmpXXXX', UNLINK => 1, DIR => $dir );
-    flock $fh, LOCK_UN;
+    my ($fh, $filename) = new_fh();
 
     my @array;
     my $obj = tie @array, 'DBM::Deep', $filename;