Cherry picks from current/for_cpan_index (flux due to not-yet-clear-policy)
[dbsrgits/DBIx-Class.git] / t / 94versioning.t
index 93fcca7..8dde154 100644 (file)
@@ -33,7 +33,7 @@ BEGIN {
 
 # this is just to grab a lock
 {
-  my $s = DBICTest::Schema->connect($dsn, $user, $pass);
+  my $s = DBICTest->connect_schema($dsn, $user, $pass);
 }
 
 # in case it came from the env
@@ -285,6 +285,17 @@ my $schema_v3 = DBICVersion::Schema->connect($dsn, $user, $pass, { ignore_versio
   ok($get_db_version_run == 0, "attributes pulled from list connect_info");
 }
 
+# at this point we have v1, v2 and v3 still connected
+# make sure they are the only connections and everything else is gone
+is
+  scalar( grep
+    { defined $_ and $_->{Active} }
+    map
+      { @{$_->{ChildHandles}} }
+      values %{ { DBI->installed_drivers } }
+  ), 3, "Expected number of connections at end of script"
+;
+
 END {
   unless ($ENV{DBICTEST_KEEP_VERSIONING_DDL}) {
     $ddl_dir->rmtree;