r11693@rob-kinyons-powerbook58: rob | 2006-04-30 22:15:38 -0400
[dbsrgits/DBM-Deep.git] / t / 30_already_tied.t
index 8d65829..7305f64 100644 (file)
@@ -4,14 +4,11 @@
 use strict;
 use Test::More tests => 7;
 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 $db = DBM::Deep->new( $filename );
 
 {
@@ -73,9 +70,6 @@ my $db = DBM::Deep->new( $filename );
     tie $scalar, 'My::Tie::Scalar';
     isa_ok( tied($scalar), 'My::Tie::Scalar' );
 
-TODO: {
-    local $TODO = "Scalar refs are just broked";
-    throws_ok {
-        $db->{foo} = \$scalar;
-    } qr/Cannot store something that is tied/, "Cannot store tied scalars";
-}
+throws_ok {
+    $db->{foo} = \$scalar;
+} qr/Storage of references of type 'SCALAR' is not supported/, "Cannot store scalar references, let alone tied scalars";