]> iEval git - app-edwardng.git/commitdiff
Use tempdir for testing
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 10 Jul 2014 10:51:53 +0000 (13:51 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 10 Jul 2014 10:51:53 +0000 (13:51 +0300)
t/App-EdwardNG.t

index 015e054d68898892171dda131067a2120a5c460a..55315242ecb16c4d5230c49d65d05ebe96f3bed4 100644 (file)
@@ -5,10 +5,15 @@ use warnings;
 use constant KEYID => '34B22806';
 use constant EMAIL => 'EdwardNG (Key for testing EdwardNG) <edwardng@ieval.ro>';
 
+use File::Copy qw/cp/;
+use File::Temp qw/tempdir/;
 use Test::More tests => 20;
 BEGIN { use_ok('App::EdwardNG', qw/import_pubkeys process_message/) };
+
+umask 0077; # GPG doesn't like group-/world-readable homedirs
 $ENV{EDWARDNG_DEBUG} = $ENV{TEST_VERBOSE};
-$ENV{EDWARDNG_KEYDIR} = 't/keydir';
+$ENV{EDWARDNG_KEYDIR} = tempdir 'App-EdwardNG-test.XXXX', TMPDIR => 1, CLEANUP => 1;
+cp "t/keydir/$_", $ENV{EDWARDNG_KEYDIR} for qw/pubring.gpg secring.gpg/;
 
 my $contains_pubkey = App::EdwardNG::mp->parse_open('t/data/contains-pubkey');
 my @keys = import_pubkeys ($contains_pubkey, App::EdwardNG::mg);
This page took 0.026539 seconds and 4 git commands to generate.