use strict;
use Test::More;
-use Test::Warn;
use lib qw(t/lib);
use File::Path;
use make_dbictest_db;
);
}
-plan tests => 4;
+plan tests => 8;
rmtree($dump_path, 1, 0711);
ok(!$@, 'no death with dump_directory set') or diag "Dump failed: $@";
DBICTest::Schema::1->loader(undef);
-warnings_like { DBICTest::Schema::1->connect($make_dbictest_db::dsn) }
- [
- qr|Dumping manual schema|,
- (qr|DBICTest/Schema/1.*?.pm exists, will not overwrite|) x 3,
- qr|Schema dump completed|
- ],
- 'warn and skip when attempting to overwrite without option';
+
+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|,
+);
+
+like(shift @warn_output, $_) foreach (@warnings_regexes);
rmtree($dump_path, 1, 0711);