Test::App::CPANIDX::Database - generate a test database for App::CPANIDX
version 0.06
use strict; use warnings; use Test::App::CPANIDX::Database; # Create a test database in the current working directory my $tdb = Test::App::CPANIDX::Database->new(); # Get the name of the test database file generated my $dbfile = $tdb->dbfile; # The test database will be automagically removed when the # object goes out of scope.
Test::App::CPANIDX::Database will generate a test database for use with App::CPANIDX deriatives.
It generates a very simple DBD::SQLite database which contains a single CPAN author FOOBAR, a single distribution Foo-Bar-0.01.tar.gz and a single module Foo::Bar.
FOOBAR
Foo-Bar-0.01.tar.gz
Foo::Bar
new
Generates a test database called cpanidx.db and returns an object reference.
cpanidx.db
Without any parameters this database file will be located in the current working directory and will be automatically removed when the object falls out of scope.
You may provide parameters to affect this behaviour.
unlink
Set this to a false value to disable the automatic removal of the test database file.
my $tdb = Test::App::CPANIDX::Database->new( unlink => 0 );
dir
Set this to an existing directory path where the database file should be created.
my $tdb = Test::App::CPANIDX::Database->new( dir => '/some/funky/path' );
dbfile
Returns the name of the database file that was generated.
App::CPANIDX
App::CPANIDX::Tables
DBD::SQLite
Chris Williams <chris@bingosnet.co.uk>
This software is copyright (c) 2017 by Chris Williams.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Test::App::CPANIDX::Database, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::App::CPANIDX::Database
CPAN shell
perl -MCPAN -e shell install Test::App::CPANIDX::Database
For more information on module installation, please visit the detailed CPAN module installation guide.