SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE




YUM REPOSITORY

 
 

MAN page from Mandriva 2010 perl-DBICx-TestDatabase-0.20.0-1mdv2010.1.noarch.rpm

DBICx::TestDatabase

Section: User Contributed Perl Documentation (3)
Updated: 2008-07-07
Index 

NAME

DBICx::TestDatabase - create a temporary database from a DBIx::Class::Schema 

SYNOPSIS

Given a DBIx::Class::Schema at "MyApp::Schema",create a test database like this:

   use DBICx::TestDatabase;   my $schema = DBICx::TestDatabase->new('MyApp::Schema');

Then you can use $schema normally:

   $schema->resultset('Blah')->create({ blah => '123' });

When your program exits, the temporary database will go away. 

DESCRIPTION

This module creates a temporary SQLite database, deploys your DBICschema, and then connects to it. This lets you easily test your DBICschema. Since you have a fresh database for every test, you don'thave to worry about cleaning up after your tests, ordering of testsaffecting failure, etc. 

METHODS

 

new($schema)

Loads $schema and returns a connection to it. 

connect

Alias for new. 

ENVIRONMENT

You can control the behavior of this module at runtime by settingenvironment variables. 

DBIC_KEEP_TEST

If this variable is true, then the test database will not be deletedat "END" time. Instead, a message containing the paths of the testdatabases will be printed.

This is good if you want to look at the database your test generated,for debugging. 

AUTHOR

Jonathan Rockway "<jrockwayAATTcpan.org>" 

LICENSE

Copyright (c) 2007 Jonathan Rockway.

This program is free software. You may use, modify, and redistributeit under the same terms as Perl itself.


 

Index

NAME
SYNOPSIS
DESCRIPTION
METHODS
new($schema)
connect
ENVIRONMENT
DBIC_KEEP_TEST
AUTHOR
LICENSE

This document was created byman2html,using the manual pages.