Data-Babel
view release on metacpan or search on metacpan
examples/babel.pl view on Meta::CPAN
database=>'test',host=>'localhost',user=>$ENV{USER},password=>''
);
# merge defaults into options (from command line processing)
@OPTIONS{keys %DEFAULTS}=values %DEFAULTS;
# open and possibly create AutoDB database
my %db_params=(create=>$OPTIONS{create},database=>$OPTIONS{database},host=>$OPTIONS{host},
user=>$OPTIONS{user},password=>$OPTIONS{password});
my $autodb=new Class::AutoDB(%db_params);
unless ($autodb->is_connected) {
my $errstr='Cannot connect to AutoDB database using supplied credentials: '.
join(', ',map {"$_=$OPTIONS{$_}"} (qw(database host user password)));
confess $errstr;
}
# set autodb class attribute in Babel
Data::Babel->autodb($autodb);
# read Babel from database if it exists
my $babel=old Data::Babel($OPTIONS{babel_name});
t/babel.000.reqs.t view on Meta::CPAN
# since we made it here, we can do everything!
return 1;
FAIL:
$errstr or $errstr=DBI->errstr;
my $diag=<<DIAG
These tests require that MySQL be running on 'localhost', that the user
running the tests can access MySQL without a password, and with these
credentials, has sufficient privileges to (1) create a 'test' database,
(2) create, alter, and drop tables in the 'test' database, (3) create and
drop views, and (4) run queries and updates on the database.
When verifying these capabilities, the test driver got the following
error message:
$errstr
DIAG
;
( run in 0.387 second using v1.01-cache-2.11-cpan-4d50c553e7e )