diff --git a/t/12-populate-basic.t b/t/12-populate-basic.t index b8cb40b..81c5905 100644 --- a/t/12-populate-basic.t +++ b/t/12-populate-basic.t @@ -63,6 +63,9 @@ foreach my $set ('simple', 'quantity', 'fetch', 'rules') { } } +# Force $schema out of scope to disconnect DB so it can be deleted +$schema = undef if ($^O eq qq{MSWin32}); + # use_create => 1 $schema = DBICTest->init_schema(db_dir => $tempdir); $fixtures = DBIx::Class::Fixtures->new({ @@ -75,6 +78,9 @@ ok( $fixtures->dump({ directory => $tempdir }), "use_create dump executed okay" ); +# Force $schema out of scope to disconnect DB so it can be deleted +$schema = undef if ($^O eq qq{MSWin32}); + $schema = DBICTest->init_schema(db_dir => $tempdir, no_populate => 1 ); $fixtures->populate({ directory => $tempdir, @@ -83,9 +89,15 @@ $fixtures->populate({ no_deploy => 1, use_create => 1 }); +# Force $schema out of scope to disconnect DB so it can be deleted +$schema = undef if ($^O eq qq{MSWin32}); + $schema = DBICTest->init_schema(db_dir => $tempdir, no_deploy => 1, no_populate => 1 ); is( $schema->resultset( "Artist" )->find({ artistid => 4 })->name, "Test Name", "use_create => 1 ok" ); +# Force $schema out of scope to disconnect DB so it can be deleted +$schema = undef if ($^O eq qq{MSWin32}); + $schema = DBICTest->init_schema(db_dir => $tempdir, no_populate => 1 ); $fixtures->populate({ directory => $tempdir, diff --git a/t/compile.t b/t/compile.t index 05ffd87..9a4b44f 100644 --- a/t/compile.t +++ b/t/compile.t @@ -4,8 +4,10 @@ use Test::Compile::Internal; use Test::More; use Module::Runtime qw[ use_module ]; use FindBin; -use lib "$FindBin::Bin/../lib"; -use lib "$FindBin::Bin/../SocialFlow-Web-Config/lib"; +use File::Spec; +use File::Basename qw(dirname basename); +use lib File::Spec->catdir(File::Spec->splitdir(dirname(__FILE__)), qw(.. lib)); +use lib File::Spec->catdir(File::Spec->splitdir(dirname(__FILE__)), qw(.. SocialFlow-Web-Config lib)); BEGIN { use FindBin; @@ -17,8 +19,8 @@ my @pms = Test::Compile::Internal->all_pm_files("lib"); plan tests => 0+@pms; for my $pm (@pms) { - $pm =~ s!(^lib/|\.pm$)!!g; - $pm =~ s|/|::|g; + $pm = join(qq{::}, File::Spec->splitdir(dirname($pm)), basename($pm)); + $pm =~ s!(^lib::|\.pm$)!!g; ok use_module($pm),$pm; $pm->import; }