sub run_loader {
my %loader_opts = @_;
- Class::Unload->unload($SCHEMA_CLASS);
+ eval {
+ foreach my $source_name ($SCHEMA_CLASS->clone->sources) {
+ Class::Unload->unload("${SCHEMA_CLASS}::${source_name}");
+ }
+
+ Class::Unload->unload($SCHEMA_CLASS);
+ };
+ undef $@;
my @connect_info = $make_dbictest_db2::dsn;
my @loader_warnings;
my $res = run_loader(naming => 'v4');
is_deeply $res->{warnings}, [], 'no warnings with naming attribute set';
+
+ run_v4_tests($res);
}
# test upgraded dynamic schema
run_v5_tests($res);
}
-
# test running against v4 schema without upgrade
{
# write out the 0.04006 Schema.pm we have in __DATA__
'correct warnings on upgrading static schema (with "naming" set)';
is scalar @{ $res->{warnings} }, 2,
-'correct number of warnings on upgrading static schema (with "naming" set)';
+'correct number of warnings on upgrading static schema (with "naming" set)'
+ or diag @{ $res->{warnings} };
run_v5_tests($res);