X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F02-instantiation-no-ddl.t;h=b892f2c1666b105ba61f396345ce7cfdb7dfb63d;hb=c50f464ee89ad9265bc608de04d6a686525311ef;hp=7355f9d00f13e89d4b5e2e0caeb0c61a835686d2;hpb=38857f30bc0d5dcae8f67823387be75a3b0d1c9a;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/t/02-instantiation-no-ddl.t b/t/02-instantiation-no-ddl.t index 7355f9d..b892f2c 100644 --- a/t/02-instantiation-no-ddl.t +++ b/t/02-instantiation-no-ddl.t @@ -11,11 +11,12 @@ use aliased 'DBIx::Class::DeploymentHandler', 'DH'; 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 = DBICDHTest::dbh(); +my @connection = (sub { $dbh }, { ignore_version => 1 }); my $sql_dir = 't/sql'; VERSION1: { @@ -34,7 +35,7 @@ VERSION1: { ok($handler, 'DBIx::Class::DeploymentHandler w/1 instantiates correctly'); my $version = $s->schema_version; - $handler->prepare_deploy; + $handler->prepare_install; dies_ok { $s->resultset('Foo')->create({ @@ -67,7 +68,7 @@ VERSION2: { ok($handler, 'DBIx::Class::DeploymentHandler w/2 instantiates correctly'); my $version = $s->schema_version(); - $handler->prepare_deploy(); + $handler->prepare_install; dies_ok { $s->resultset('Foo')->create({ bar => 'frew', @@ -104,7 +105,7 @@ VERSION3: { ok($handler, 'DBIx::Class::DeploymentHandler w/3 instantiates correctly'); my $version = $s->schema_version(); - $handler->prepare_deploy; + $handler->prepare_install; dies_ok { $s->resultset('Foo')->create({ bar => 'frew', @@ -158,6 +159,10 @@ DOWN2: { baz => 'frew', }) } 'schema is at version 2'; + + is $handler->version_storage->database_version => 2, + 'database version is down to 2'; + } done_testing;