8 use dbixcsl_test_dir qw/$tdir/;
10 my $dump_path = "$tdir/dump";
14 package DBICTest::Schema::1;
15 use base qw/ DBIx::Class::Schema::Loader /;
16 __PACKAGE__->loader_options(
17 dump_directory => $dump_path,
22 package DBICTest::Schema::2;
23 use base qw/ DBIx::Class::Schema::Loader /;
24 __PACKAGE__->loader_options(
25 dump_directory => $dump_path,
26 really_erase_my_files => 1,
30 rmtree($dump_path, 1, 1);
33 warnings_exist { DBICTest::Schema::1->connect($make_dbictest_db::dsn) }
34 [ qr|^Dumping manual schema|, qr|^Schema dump completed| ];
35 } 'no death with dump_directory set' or diag "Dump failed: $@";
37 DBICTest::Schema::1->_loader_invoked(undef);
40 skip "ActiveState perl produces additional warnings", 1
41 if ($^O eq 'MSWin32');
43 warnings_exist { DBICTest::Schema::1->connect($make_dbictest_db::dsn) }
44 [ qr|^Dumping manual schema|, qr|^Schema dump completed| ];
46 rmtree($dump_path, 1, 1);
50 warnings_exist { DBICTest::Schema::2->connect($make_dbictest_db::dsn) }
51 [ qr|^Dumping manual schema|, qr|^Schema dump completed| ];
52 } 'no death with dump_directory set (overwrite1)' or diag "Dump failed: $@";
54 DBICTest::Schema::2->_loader_invoked(undef);
57 warnings_exist { DBICTest::Schema::2->connect($make_dbictest_db::dsn) }
59 qr/^Dumping manual schema/,
60 qr|^Deleting .+Schema/2.+ due to 'really_erase_my_files'|,
61 qr|^Deleting .+Schema/2/Result/Foo.+ due to 'really_erase_my_files'|,
62 qr|^Deleting .+Schema/2/Result/Bar.+ due to 'really_erase_my_files'|,
63 qr/^Schema dump completed/
65 } 'no death with dump_directory set (overwrite2)' or diag "Dump failed: $@";
69 END { rmtree($dump_path, 1, 1); }