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 );
{
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";