7 my $dump_path = './t/_dump';
10 package DBICTest::Schema::1;
11 use base qw/ DBIx::Class::Schema::Loader /;
12 __PACKAGE__->loader_options(
14 dump_directory => $dump_path,
19 package DBICTest::Schema::2;
20 use base qw/ DBIx::Class::Schema::Loader /;
21 __PACKAGE__->loader_options(
23 dump_directory => $dump_path,
30 rmtree($dump_path, 1, 1);
32 eval { DBICTest::Schema::1->connect($make_dbictest_db::dsn) };
33 ok(!$@, 'no death with dump_directory set') or diag "Dump failed: $@";
35 DBICTest::Schema::1->_loader_invoked(undef);
38 skip "ActiveState perl produces additional warnings", 5
39 if ($^O eq 'MSWin32');
43 local $SIG{__WARN__} = sub { push(@warn_output, @_) };
44 DBICTest::Schema::1->connect($make_dbictest_db::dsn);
46 my @warnings_regexes = (
47 qr|Dumping manual schema|,
48 qr|Schema dump completed|,
51 like(shift @warn_output, $_) foreach (@warnings_regexes);
53 rmtree($dump_path, 1, 1);
56 eval { DBICTest::Schema::2->connect($make_dbictest_db::dsn) };
57 ok(!$@, 'no death with dump_directory set (overwrite1)')
58 or diag "Dump failed: $@";
60 DBICTest::Schema::2->_loader_invoked(undef);
61 eval { DBICTest::Schema::2->connect($make_dbictest_db::dsn) };
62 ok(!$@, 'no death with dump_directory set (overwrite2)')
63 or diag "Dump failed: $@";
65 # END { rmtree($dump_path, 1, 1); }