1) forgot to add some t/5* tests to the MANIFEST 2) The one line patch to Engine...
[dbsrgits/DBM-Deep.git] / t / 26_scalar_ref.t
index 06beda8..7f6e3e7 100644 (file)
@@ -2,14 +2,11 @@ use strict;
 
 use Test::More tests => 10;
 use Test::Exception;
-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 $x = 25;
 {
@@ -17,22 +14,22 @@ my $x = 25;
 
     throws_ok {
         $db->{scalarref} = \$x;
-    } qr/Storage of variables of type 'SCALAR' is not supported/,
+    } qr/Storage of references of type 'SCALAR' is not supported/,
     'Storage of scalar refs not supported';
 
     throws_ok {
         $db->{scalarref} = \\$x;
-    } qr/Storage of variables of type 'REF' is not supported/,
+    } qr/Storage of references of type 'REF' is not supported/,
     'Storage of ref refs not supported';
 
     throws_ok {
         $db->{scalarref} = sub { 1 };
-    } qr/Storage of variables of type 'CODE' is not supported/,
+    } qr/Storage of references of type 'CODE' is not supported/,
     'Storage of code refs not supported';
 
     throws_ok {
-        $db->{scalarref} = $db->_get_self->_fh;
-    } qr/Storage of variables of type 'GLOB' is not supported/,
+        $db->{scalarref} = $fh;
+    } qr/Storage of references of type 'GLOB' is not supported/,
     'Storage of glob refs not supported';
 
     $db->{scalar} = $x;