use File::Path 'remove_tree';
use Test::More;
use Test::Exception;
+use DBI;
DBICDHTest::ready;
-
-my $db = 'dbi:SQLite:db.db';
-my @connection = ($db, '', '', { ignore_version => 1 });
+my $dbh = DBI->connect('dbi:SQLite::memory:');
+my @connection = (sub { $dbh }, { ignore_version => 1 });
my $sql_dir = 't/sql';
VERSION1: {
DBICDHTest::ready;
-my $db = 'dbi:SQLite:db.db';
-my @connection = ($db, '', '', { ignore_version => 1 });
+my $dbh = DBI->connect('dbi:SQLite::memory:');
+my @connection = (sub { $dbh }, { ignore_version => 1 });
my $sql_dir = 't/sql';
VERSION1: {
DBICDHTest::ready;
-my $db = 'dbi:SQLite:db.db';
-my @connection = ($db, '', '', { ignore_version => 1 });
+my $dbh = DBI->connect('dbi:SQLite::memory:');
+my @connection = (sub { $dbh }, { ignore_version => 1 });
my $sql_dir = 't/sql';
VERSION1: {
DBICDHTest::ready;
-my $db = 'dbi:SQLite:db.db';
-my @connection = ($db, '', '', { ignore_version => 1 });
+my $dbh = DBI->connect('dbi:SQLite::memory:');
+my @connection = (sub { $dbh }, { ignore_version => 1 });
my $sql_dir = 't/sql';
VERSION1: {
DBICDHTest::ready;
-my $db = 'dbi:SQLite:db.db';
-my @connection = ($db, '', '', { ignore_version => 1, }, { on_connect_do => sub { die }});
+my $db = 'dbi:SQLite::memory:';
+my @connection = ($db, '', '', { ignore_version => 1, on_connect_do => sub { die }});
my $sql_dir = 't/sql';
VERSION1: {
use File::Spec::Functions;
use File::Path qw(rmtree mkpath);
-my $db = 'dbi:SQLite:db.db';
-my @connection = ($db, '', '', { ignore_version => 1 });
+my $dbh = DBI->connect('dbi:SQLite::memory:');
+my @connection = (sub { $dbh }, { ignore_version => 1 });
my $sql_dir = 't/sql';
DBICDHTest::ready;
use File::Spec::Functions;
-my $db = 'dbi:SQLite:db.db';
-my @connection = ($db, '', '', { ignore_version => 1 });
+my $dbh = DBI->connect('dbi:SQLite::memory:');
+my @connection = (sub { $dbh }, { ignore_version => 1 });
my $sql_dir = 't/sql';
DBICDHTest::ready;
$version = $s->schema_version;
$dm->prepare_deploy;
$dm->prepare_upgrade({
- from_version => '1.0',
- to_version => $version,
- version_set => ['1.0', $version]
+ from_version => '1.0',
+ to_version => $version,
+ version_set => ['1.0', $version]
});
dies_ok {
$s->resultset('Foo')->create({
use File::Spec::Functions;
use File::Path qw(rmtree mkpath);
-my $db = 'dbi:SQLite:db.db';
-my @connection = ($db, '', '', { ignore_version => 1 });
+my $dbh = DBI->connect('dbi:SQLite::memory:');
+my @connection = (sub { $dbh }, { ignore_version => 1 });
my $sql_dir = 't/sql';
DBICDHTest::ready;
use Test::Exception;
sub ready {
- unlink 'db.db' if -e 'db.db';
if (-d 't/sql') {
remove_tree('t/sql');
mkdir 't/sql';
use Test::Exception;
sub ready {
- unlink 'db.db' if -e 'db.db';
if (-d 't/sql') {
remove_tree('t/sql');
mkdir 't/sql';
use DBICVersion_v1;
use DBIx::Class::DeploymentHandler;
-my $db = 'dbi:SQLite:db.db';
-my @connection = ($db, '', '', { ignore_version => 1 });
+my $dbh = DBI->connect('dbi:SQLite::memory:');
+my @connection = (sub { $dbh }, { ignore_version => 1 });
my $sql_dir = 't/sql';
my $s = DBICVersion::Schema->connect(@connection);
'adding another version works correctly'
);
+my $u;
{
my $warning;
local $SIG{__WARN__} = sub {$warning = shift};
- my $u = DBICVersion::Schema->connect($db, '', '');
- like( $warning, qr/Versions out of sync. This is 1.0, your database contains version 2.0, please call upgrade on your Schema./, 'warning when database/schema mismatch');
+ $u = DBICVersion::Schema->connect(sub { $dbh });
+ like( $warning, qr/Versions out of sync. This is 1\.0, your database contains version 2\.0, please call upgrade on your Schema\./, 'warning when database/schema mismatch');
}
+++ /dev/null
-#!perl
-
-use Test::More;
-use Test::Exception;
-
-use lib 't/lib';
-use DBICDHTest;
-use_ok 'DBIx::Class::DeploymentHandler::VersionStorage::Standard';
-
-done_testing;