X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fdeploy_methods%2Fsql_translator_protoschema_transform.t;h=a37aab5db4b2d1cb2d1a5a33ddb17ac404113f04;hb=refs%2Fheads%2Fmigration_schema;hp=d697b3c0534f4cbba6e701a409297c23d36d1d7b;hpb=f9c6ab503d63cc70fa884cadb7ed5f105f1a7bc8;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/t/deploy_methods/sql_translator_protoschema_transform.t b/t/deploy_methods/sql_translator_protoschema_transform.t index d697b3c..a37aab5 100644 --- a/t/deploy_methods/sql_translator_protoschema_transform.t +++ b/t/deploy_methods/sql_translator_protoschema_transform.t @@ -1,5 +1,8 @@ #!perl +use strict; +use warnings; + use Test::More; use Test::Exception; @@ -9,15 +12,15 @@ use aliased 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator'; use File::Spec::Functions; use File::Path qw(rmtree mkpath); -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'; DBICDHTest::ready; VERSION1: { use_ok 'DBICVersion_v1'; - my $s = DBICVersion::Schema->connect(@connection); + my $s = DBICVersion::Schema1->connect(@connection); my $dm = Translator->new({ schema => $s, script_directory => $sql_dir, @@ -31,7 +34,7 @@ VERSION1: { VERSION2: { use_ok 'DBICVersion_v2'; - my $s = DBICVersion::Schema->connect(@connection); + my $s = DBICVersion::Schema2->connect(@connection); my $dm = Translator->new({ schema => $s, script_directory => $sql_dir, @@ -40,11 +43,10 @@ VERSION2: { txn_wrap => 1, }); - $version = $s->schema_version(); $dm->prepare_deploy; - mkpath(catfile(qw( t sql _protoschema up 1.0-2.0 ))); + mkpath(catfile(qw( t sql _preprocess_schema upgrade 1.0-2.0 ))); open my $prerun, '>', - catfile(qw( t sql _protoschema up 1.0-2.0 003-semiautomatic.pl )); + catfile(qw( t sql _preprocess_schema upgrade 1.0-2.0 003-semiautomatic.pl )); print {$prerun} 'sub { use File::Touch;