[Bast-commits] r9326 -
DBIx-Class/0.08/branches/dbicadmin-non-versioned/t/admin
edenc at dev.catalyst.perl.org
edenc at dev.catalyst.perl.org
Fri May 7 16:15:47 GMT 2010
Author: edenc
Date: 2010-05-07 17:15:47 +0100 (Fri, 07 May 2010)
New Revision: 9326
Modified:
DBIx-Class/0.08/branches/dbicadmin-non-versioned/t/admin/02ddl.t
Log:
added failing test case for non-versioned schema deploy attempt
Modified: DBIx-Class/0.08/branches/dbicadmin-non-versioned/t/admin/02ddl.t
===================================================================
--- DBIx-Class/0.08/branches/dbicadmin-non-versioned/t/admin/02ddl.t 2010-05-07 14:58:22 UTC (rev 9325)
+++ DBIx-Class/0.08/branches/dbicadmin-non-versioned/t/admin/02ddl.t 2010-05-07 16:15:47 UTC (rev 9326)
@@ -37,11 +37,12 @@
my $admin = DBIx::Class::Admin->new(
schema_class=> "DBICTest::Schema",
sql_dir=> $sql_dir,
- connect_info => \@connect_info,
+ connect_info => \@connect_info,
);
isa_ok ($admin, 'DBIx::Class::Admin', 'create the admin object');
lives_ok { $admin->create('MySQL'); } 'Can create MySQL sql';
lives_ok { $admin->create('SQLite'); } 'Can Create SQLite sql';
+lives_ok { $admin->deploy() } 'Can Deploy schema';
}
{ # upgrade schema
@@ -56,7 +57,7 @@
require DBICVersion_v1;
my $admin = DBIx::Class::Admin->new(
- schema_class => 'DBICVersion::Schema',
+ schema_class => 'DBICVersion::Schema',
sql_dir => $sql_dir,
connect_info => \@connect_info,
);
@@ -75,7 +76,7 @@
require DBICVersion_v2;
$admin = DBIx::Class::Admin->new(
- schema_class => 'DBICVersion::Schema',
+ schema_class => 'DBICVersion::Schema',
sql_dir => $sql_dir,
connect_info => \@connect_info
);
@@ -84,6 +85,7 @@
{
local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /DB version .+? is lower than the schema version/ };
lives_ok {$admin->upgrade();} 'upgrade the schema';
+ dies_ok {$admin->deploy} 'cannot deploy installed schema, should upgrade instead';
}
is($schema->get_db_version, $DBICVersion::Schema::VERSION, 'Schema and db versions match');
@@ -95,7 +97,7 @@
clean_dir($sql_dir);
my $admin = DBIx::Class::Admin->new(
- schema_class => 'DBICVersion::Schema',
+ schema_class => 'DBICVersion::Schema',
sql_dir => $sql_dir,
_confirm => 1,
connect_info => \@connect_info,
@@ -122,7 +124,7 @@
}
foreach my $file ($dir->children) {
# skip any hidden files
- next if ($file =~ /^\./);
+ next if ($file =~ /^\./);
unlink $file;
}
}
More information about the Bast-commits
mailing list