Test::Database::Driver::DBM - A Test::Database driver for DBM


Test-Database documentation Contained in the Test-Database distribution.

Index


Code Index:

NAME

Top

Test::Database::Driver::DBM - A Test::Database driver for DBM

SYNOPSIS

Top

    use Test::Database;
    my @handles = Test::Database->handles( 'DBM' );

DESCRIPTION

Top

This module is the Test::Database driver for DBD::DBM.

SEE ALSO

Top

Test::Database::Driver

AUTHOR

Top

Philippe Bruhat (BooK), <book@cpan.org>

COPYRIGHT

Top

LICENSE

Top

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


Test-Database documentation Contained in the Test-Database distribution.

package Test::Database::Driver::DBM;
use strict;
use warnings;

use File::Spec;
use File::Path;
use DBD::DBM;

use Test::Database::Driver;
our @ISA = qw( Test::Database::Driver );

sub is_filebased {1}

sub _version { return DBD::DBM->VERSION; }

sub dsn {
    my ( $self, $dbname ) = @_;
    my $dbdir = File::Spec->catdir( $self->base_dir(), $dbname );
    mkpath( [$dbdir] );
    return $self->make_dsn( f_dir => $dbdir );
}

sub drop_database {
    my ( $self, $dbname ) = @_;
    my $dbdir = File::Spec->catdir( $self->base_dir(), $dbname );
    rmtree( [$dbdir] );
}

'DBM';

__END__