X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F94versioning.t;h=ad4657ecce3deab9f51da6c3cb665737cbb00ebf;hb=dc35bbe6c1643c77b033d4e9f45daa6a8e4184e4;hp=b73d6122423f633dc05685a140735a66ac45e476;hpb=b703fec7f5767eb8240771f1a07a518b34855768;p=dbsrgits%2FDBIx-Class.git diff --git a/t/94versioning.t b/t/94versioning.t index b73d612..ad4657e 100644 --- a/t/94versioning.t +++ b/t/94versioning.t @@ -245,6 +245,33 @@ system( qq($^X -pi -e "s/ALTER/-- this is a comment\nALTER/" $fn->{trans_v23};) is($schema_v2->get_db_version(), '3.0', 'Fast deploy/upgrade'); }; +# Check that it Schema::Versioned deals with new/all forms of connect arguments. +{ + my $get_db_version_run = 0; + + no warnings qw/once redefine/; + local *DBIx::Class::Schema::Versioned::get_db_version = sub { + $get_db_version_run = 1; + return $_[0]->schema_version; + }; + + # Make sure the env var isn't whats triggering it + local $ENV{DBIC_NO_VERSION_CHECK} = 0; + + DBICVersion::Schema->connect({ + dsn => $dsn, + user => $user, + pass => $pass, + ignore_version => 1 + }); + + ok($get_db_version_run == 0, "attributes pulled from hashref connect_info"); + $get_db_version_run = 0; + + DBICVersion::Schema->connect( $dsn, $user, $pass, { ignore_version => 1 } ); + ok($get_db_version_run == 0, "attributes pulled from list connect_info"); +} + unless ($ENV{DBICTEST_KEEP_VERSIONING_DDL}) { unlink $_ for (values %$fn); }