Added unflocks to all tests so that the tests run on OSX
[dbsrgits/DBM-Deep.git] / t / 25_tie_return_value.t
1 use strict;
2
3 use Test::More tests => 5;
4 use File::Temp qw( tempfile tempdir );
5 use Fcntl qw( :flock );
6
7 use_ok( 'DBM::Deep' );
8
9 my $dir = tempdir( CLEANUP => 1 );
10
11 use Scalar::Util qw( reftype );
12
13 {
14     my ($fh, $filename) = tempfile( 'tmpXXXX', UNLINK => 1, DIR => $dir );
15     flock $fh, LOCK_UN;
16
17     my %hash;
18     my $obj = tie %hash, 'DBM::Deep', $filename;
19     isa_ok( $obj, 'DBM::Deep' );
20     is( reftype( $obj ), 'HASH', "... and its underlying representation is an HASH" );
21 }
22
23 {
24     my ($fh, $filename) = tempfile( 'tmpXXXX', UNLINK => 1, DIR => $dir );
25     flock $fh, LOCK_UN;
26
27     my @array;
28     my $obj = tie @array, 'DBM::Deep', $filename;
29     isa_ok( $obj, 'DBM::Deep' );
30     is( reftype( $obj ), 'HASH', "... and its underlying representation is an HASH" );
31 }