Bump version for 0.04006 release
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / 22dump.t
index 19efcbc..a10c483 100644 (file)
@@ -10,7 +10,6 @@ my $dump_path = './t/_dump';
     package DBICTest::Schema::1;
     use base qw/ DBIx::Class::Schema::Loader /;
     __PACKAGE__->loader_options(
-        relationships => 1,
         dump_directory => $dump_path,
     );
 }
@@ -19,41 +18,45 @@ my $dump_path = './t/_dump';
     package DBICTest::Schema::2;
     use base qw/ DBIx::Class::Schema::Loader /;
     __PACKAGE__->loader_options(
-        relationships => 1,
         dump_directory => $dump_path,
-        dump_overwrite => 1,
+        really_erase_my_files => 1,
     );
 }
 
-plan tests => 8;
+plan tests => 5;
 
-rmtree($dump_path, 1, 0711);
+rmtree($dump_path, 1, 1);
 
 eval { DBICTest::Schema::1->connect($make_dbictest_db::dsn) };
 ok(!$@, 'no death with dump_directory set') or diag "Dump failed: $@";
 
-DBICTest::Schema::1->loader(undef);
+DBICTest::Schema::1->_loader_invoked(undef);
 
-my @warn_output;
-{
-    local $SIG{__WARN__} = sub { push(@warn_output, @_) };
-    DBICTest::Schema::1->connect($make_dbictest_db::dsn);
-}
-my @warnings_regexes = (
-    qr|Dumping manual schema|,
-    (qr|DBICTest/Schema/1.*?.pm exists, will not overwrite|) x 3,
-    qr|Schema dump completed|,
-);
+SKIP: {
+  my @warnings_regexes = (
+      qr|Dumping manual schema|,
+      qr|Schema dump completed|,
+  );
+
+  skip "ActiveState perl produces additional warnings", scalar @warnings_regexes
+    if ($^O eq 'MSWin32');
 
-like(shift @warn_output, $_) foreach (@warnings_regexes);
+  my @warn_output;
+  {
+      local $SIG{__WARN__} = sub { push(@warn_output, @_) };
+      DBICTest::Schema::1->connect($make_dbictest_db::dsn);
+  }
 
-rmtree($dump_path, 1, 0711);
+  like(shift @warn_output, $_) foreach (@warnings_regexes);
+
+  rmtree($dump_path, 1, 1);
+}
 
 eval { DBICTest::Schema::2->connect($make_dbictest_db::dsn) };
 ok(!$@, 'no death with dump_directory set (overwrite1)')
     or diag "Dump failed: $@";
 
-DBICTest::Schema::2->loader(undef);
+DBICTest::Schema::2->_loader_invoked(undef);
 eval { DBICTest::Schema::2->connect($make_dbictest_db::dsn) };
 ok(!$@, 'no death with dump_directory set (overwrite2)')
     or diag "Dump failed: $@";