X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F02-instantiation.t;h=7d673099496fe15df9ba8e5772af1da887caa007;hb=aa5ad00e656c25a27bb08df4443ec0adecc7c524;hp=73e92de0486f34adf0f0d93ac0a8644e3eb35e86;hpb=24f4524be2492ee3699f7ee87eb899238c6268c7;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/t/02-instantiation.t b/t/02-instantiation.t index 73e92de..7d67309 100644 --- a/t/02-instantiation.t +++ b/t/02-instantiation.t @@ -2,6 +2,7 @@ use Test::More; use Test::Exception; +use File::Path 'remove_tree'; use lib 't/lib'; use DBICTest; @@ -12,8 +13,7 @@ my $sql_dir = 't/sql'; unlink 'db.db' if -e 'db.db'; if (-d 't/sql') { - unlink $_ for glob('t/sql/*'); -} else { + remove_tree('t/sql'); mkdir 't/sql'; } @@ -31,8 +31,8 @@ VERSION1: { ok($handler, 'DBIx::Class::DeploymentHandler w/1.0 instantiates correctly'); my $version = $s->schema_version(); - $handler->create_install_ddl(); - ok(-e 't/sql/DBICVersion-Schema-1.0-SQLite.sql', 'DDL for 1.0 got created successfully'); + $handler->prepare_install(); + #ok(-e 't/sql/DBICVersion-Schema-schema-1.0-SQLite.sql', 'DDL for 1.0 got created successfully'); dies_ok { $s->resultset('Foo')->create({ @@ -60,10 +60,10 @@ VERSION2: { ok($handler, 'DBIx::Class::DeploymentHandler w/2.0 instantiates correctly'); $version = $s->schema_version(); - $handler->create_install_ddl(); - $handler->create_update_ddl($version, '1.0'); - ok(-e 't/sql/DBICVersion-Schema-2.0-SQLite.sql', 'DDL for 2.0 got created successfully'); - ok(-e 't/sql/DBICVersion-Schema-1.0-2.0-SQLite.sql', 'DDL for migration from 1.0 to 2.0 got created successfully'); + $handler->prepare_install(); + $handler->prepare_update('1.0', $version); + #ok(-e 't/sql/DBICVersion-Schema-schema-2.0-SQLite.sql', 'DDL for 2.0 got created successfully'); + #ok(-e 't/sql/DBICVersion-Schema-diff-1.0-2.0-SQLite.sql', 'DDL for migration from 1.0 to 2.0 got created successfully'); dies_ok { $s->resultset('Foo')->create({ bar => 'frew', @@ -77,7 +77,7 @@ VERSION2: { baz => 'frew', }) } 'schema not uppgrayyed'; - $handler->upgrade_single_step(['1.0', '2.0']); + $handler->upgrade; lives_ok { $s->resultset('Foo')->create({ bar => 'frew', @@ -99,12 +99,12 @@ VERSION3: { ok($handler, 'DBIx::Class::DeploymentHandler w/3.0 instantiates correctly'); $version = $s->schema_version(); - $handler->create_install_ddl; - $handler->create_update_ddl( $version, '1.0'); - $handler->create_update_ddl( $version, '2.0'); - ok(-e 't/sql/DBICVersion-Schema-3.0-SQLite.sql', 'DDL for 3.0 got created successfully'); - ok(-e 't/sql/DBICVersion-Schema-1.0-3.0-SQLite.sql', 'DDL for migration from 1.0 to 3.0 got created successfully'); - ok(-e 't/sql/DBICVersion-Schema-2.0-3.0-SQLite.sql', 'DDL for migration from 2.0 to 3.0 got created successfully'); + $handler->prepare_install; + $handler->prepare_update( '1.0', $version ); + $handler->prepare_update( '2.0', $version ); + #ok(-e 't/sql/DBICVersion-Schema-schema-3.0-SQLite.sql', 'DDL for 3.0 got created successfully'); + #ok(-e 't/sql/DBICVersion-Schema-diff-1.0-3.0-SQLite.sql', 'DDL for migration from 1.0 to 3.0 got created successfully'); + #ok(-e 't/sql/DBICVersion-Schema-diff-2.0-3.0-SQLite.sql', 'DDL for migration from 2.0 to 3.0 got created successfully'); dies_ok { $s->resultset('Foo')->create({ bar => 'frew',