Fix for [RT #32462]: avoid leading temp files around
[dbsrgits/DBM-Deep.git] / t / 25_tie_return_value.t
index dfb875a..33943f3 100644 (file)
@@ -1,28 +1,26 @@
 use strict;
 
 use Test::More tests => 5;
-
-use Scalar::Util qw( reftype );
+use t::common qw( new_fh );
 
 use_ok( 'DBM::Deep' );
 
+use Scalar::Util qw( reftype );
+
 {
-    unlink "t/test.db";
+    my ($fh, $filename) = new_fh();
 
     my %hash;
-    my $obj = tie %hash, 'DBM::Deep', 't/test.db';
+    my $obj = tie %hash, 'DBM::Deep', $filename;
     isa_ok( $obj, 'DBM::Deep' );
     is( reftype( $obj ), 'HASH', "... and its underlying representation is an HASH" );
 }
 
 {
-    unlink "t/test.db";
+    my ($fh, $filename) = new_fh();
 
     my @array;
-    my $obj = tie @array, 'DBM::Deep', 't/test.db';
+    my $obj = tie @array, 'DBM::Deep', $filename;
     isa_ok( $obj, 'DBM::Deep' );
-    TODO: {
-        local $TODO = "_init() returns a blessed hashref";
-        is( reftype( $obj ), 'ARRAY', "... and its underlying representation is an ARRAY" );
-    }
+    is( reftype( $obj ), 'HASH', "... and its underlying representation is an HASH" );
 }