X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fadmin%2F02ddl.t;h=34957deb60f5666e78ed71533f3a77d708aca723;hb=c227b29575255c89a20ebd528dd2be0229c5f2da;hp=8191b5055869e1a5fa002ec047c90969a086c471;hpb=34963a093bf1e1a2306075d586372607290da7b2;p=dbsrgits%2FDBIx-Class.git diff --git a/t/admin/02ddl.t b/t/admin/02ddl.t index 8191b50..34957de 100644 --- a/t/admin/02ddl.t +++ b/t/admin/02ddl.t @@ -1,19 +1,3 @@ -# -#=============================================================================== -# -# FILE: 02admin..t -# -# DESCRIPTION: -# -# FILES: --- -# BUGS: --- -# NOTES: --- -# AUTHOR: Gordon Irving (), -# VERSION: 1.0 -# CREATED: 28/11/09 16:14:21 GMT -# REVISION: --- -#=============================================================================== - use strict; use warnings; @@ -21,19 +5,21 @@ use Test::More; use Test::Exception; use Test::Warn; - BEGIN { - eval "use DBIx::Class::Admin"; - plan skip_all => "Deps not installed: $@" if $@; -} + require DBIx::Class; + plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('admin') + unless DBIx::Class::Optional::Dependencies->req_ok_for('admin'); + plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('deploy') + unless DBIx::Class::Optional::Dependencies->req_ok_for('deploy'); +} use lib qw(t/lib); use DBICTest; use Path::Class; -use ok 'DBIx::Class::Admin'; +use_ok 'DBIx::Class::Admin'; my $sql_dir = dir(qw/t var/); @@ -67,7 +53,7 @@ lives_ok { $admin->create('SQLite'); } 'Can Create SQLite sql'; #); clean_dir($sql_dir); -require DBICVersionOrig; +require DBICVersion_v1; my $admin = DBIx::Class::Admin->new( schema_class => 'DBICVersion::Schema', @@ -86,7 +72,7 @@ lives_ok { $schema = DBICVersion::Schema->connect(@{$schema->storage->connect_in is($schema->get_db_version, $DBICVersion::Schema::VERSION, 'Schema deployed and versions match'); -require DBICVersionNew; +require DBICVersion_v2; $admin = DBIx::Class::Admin->new( schema_class => 'DBICVersion::Schema', @@ -95,9 +81,6 @@ $admin = DBIx::Class::Admin->new( ); lives_ok { $admin->create($schema->storage->sqlt_type(), {}, "1.0" ); } 'Can create diff for ' . $schema->storage->sqlt_type; -# sleep required for upgrade table to hold a distinct time of upgrade value -# otherwise the returned of get_db_version can be undeterministic -sleep 1; { local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /DB version .+? is lower than the schema version/ }; lives_ok {$admin->upgrade();} 'upgrade the schema'; @@ -122,7 +105,7 @@ $admin->version("3.0"); lives_ok { $admin->install(); } 'install schema version 3.0'; is($admin->schema->get_db_version, "3.0", 'db thinks its version 3.0'); dies_ok { $admin->install("4.0"); } 'cannot install to allready existing version'; -sleep 1; + $admin->force(1); warnings_exist ( sub { lives_ok { $admin->install("4.0") } 'can force install to allready existing version'