Fixed more permission and dependency issues

Change-Id: I004bb23031dbb9bb7464d258d9306e7254b2e2a4
diff --git a/t/script/archive_tar.t b/t/script/archive_tar.t
index 666e2c5..a31e9b0 100644
--- a/t/script/archive_tar.t
+++ b/t/script/archive_tar.t
@@ -3,7 +3,7 @@
 use warnings;
 use File::Basename 'dirname';
 use File::Spec::Functions qw/catdir catfile/;
-use File::Temp qw/tempdir/;
+use File::Temp qw/:POSIX tempdir/;
 use Mojo::File;
 use Mojo::Util qw/quote/;
 use Mojo::JSON qw/decode_json/;
@@ -45,12 +45,15 @@
 
 my $input_quotes = "'".catfile($f, '..', 'corpus', 'archives', 'wpd15*.zip') . "'";
 
+my $cache = tmpnam();
+
 $call = join(
   ' ',
   'perl', $script,
   'archive',
   '--input' => $input_quotes,
   '--output' => $output . '.tar',
+  '--cache' => $cache,
   '-t' => 'Base#tokens_aggr',
   '--to-tar'
 );
diff --git a/t/script/base.t b/t/script/base.t
index 8e50e0d..326f4e6 100644
--- a/t/script/base.t
+++ b/t/script/base.t
@@ -19,6 +19,7 @@
 ok(-d $input, 'Input directory found');
 
 my $output = tmpnam();
+my $cache = tmpnam();
 
 ok(!-f $output, 'Output does not exist');
 
@@ -27,6 +28,7 @@
   'perl', $script,
   '--input' => $input,
   '--output' => $output,
+  '--cache' => $cache,
   '-t' => 'Base#tokens_aggr',
   '-bs' => 'DeReKo#Structure',
   '-bp' => 'DeReKo#Structure',
diff --git a/t/script/config.t b/t/script/config.t
index 8a5f46e..628409b 100644
--- a/t/script/config.t
+++ b/t/script/config.t
@@ -1,10 +1,9 @@
 #/usr/bin/env perl
 use strict;
 use warnings;
-
 use File::Basename 'dirname';
 use File::Spec::Functions qw/catdir catfile/;
-use File::Temp qw/ :POSIX tempfile/;
+use File::Temp qw/:POSIX tempfile/;
 use Mojo::File;
 use Test::More;
 use Test::Output qw/combined_from/;
@@ -40,13 +39,16 @@
 # Temporary output
 my $output = File::Temp->newdir(CLEANUP => 0);
 
+my $cache = tmpnam();
+
 my $call = join(
   ' ',
   'perl', $script,
   'archive',
   '--config' => $cfg_file,
   '--input' => $input,
-  '--output' => $output
+  '--output' => $output,
+  '--cache' => $cache
 );
 
 like($call, qr!config!, 'Call string');
diff --git a/t/script/extract.t b/t/script/extract.t
index 6420e52..4478a5f 100644
--- a/t/script/extract.t
+++ b/t/script/extract.t
@@ -4,7 +4,6 @@
 use File::Basename 'dirname';
 use File::Spec::Functions qw/catdir catfile/;
 use File::Temp qw/:POSIX tempdir/;
-use Mojo::Util qw/slurp/;
 use Mojo::JSON qw/decode_json/;
 use IO::Uncompress::Gunzip;
 use Test::More;
diff --git a/t/script/serial.t b/t/script/serial.t
index 6fb883f..ab71634 100644
--- a/t/script/serial.t
+++ b/t/script/serial.t
@@ -4,7 +4,7 @@
 use Test::Output qw/stdout_from/;
 use File::Basename 'dirname';
 use File::Spec::Functions qw/catdir catfile/;
-use File::Temp qw/tempdir/;
+use File::Temp qw/:POSIX/;
 
 my $f = dirname(__FILE__);
 my $script = catfile($f, '..', '..', 'script', 'korapxml2krill');
@@ -14,6 +14,8 @@
 # Temporary output
 my $output = File::Temp->newdir(CLEANUP => 0);
 
+my $cache = tmpnam();
+
 my $call = join(
   ' ',
   'perl', $script,
@@ -21,6 +23,7 @@
   '-t' => 'Base#tokens_aggr',
   '-i' => '"archive.zip"',
   '-i' => '"archives/wpd15*.zip"',
+  '--cache' => $cache,
   '-ib' => $input_base,
   '-o' => $output
 );
diff --git a/t/script/usage.t b/t/script/usage.t
index 170eccb..be09872 100644
--- a/t/script/usage.t
+++ b/t/script/usage.t
@@ -4,7 +4,7 @@
 use File::Basename 'dirname';
 use File::Spec::Functions qw/catdir catfile/;
 use File::Temp qw/ :POSIX /;
-use Mojo::Util qw/slurp/;
+use Mojo::File;
 use Mojo::JSON qw/decode_json/;
 use IO::Uncompress::Gunzip;
 use Test::More;