update tests for l10n
[gitmo/moose-website.git] / t / 01-validate.t
index 41ade21..a1a9a67 100644 (file)
@@ -6,6 +6,7 @@ use warnings FATAL => 'all';
 use Capture::Tiny qw(capture);
 use File::Next qw();
 use File::Which qw(which);
+use Module::Build qw();
 use Test::More;
 
 # Skip means sweep bugs under the rug.
@@ -13,20 +14,15 @@ use Test::More;
 BAIL_OUT 'xmllint (part of the libxml2 package) not installed.'
   unless which 'xmllint';
 
-my $destdir;
-{
-    my $runtime_params_file = '_build/runtime_params';
-    my $runtime_params      = do $runtime_params_file;
-    die "Could not load $runtime_params_file. Run Build.PL first.\n"
-      unless $runtime_params;
-    $destdir = $runtime_params->{destdir};
-}
+my $build;
+eval { $build = Module::Build->current; 1; }
+  or BAIL_OUT 'We are not in a Module::Build session. Run Build.PL first.';
 
 my $iter = File::Next::files({
         file_filter => sub {/\.html \z/msx},
         sort_files  => 1,
     },
-    $destdir
+    $build->destdir
 );
 
 my $file_counter;