From: Marius Gavrilescu Date: Thu, 10 Jul 2014 10:51:53 +0000 (+0300) Subject: Use tempdir for testing X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=03793e5654f0abecc5de6838fa456a23bae630cc;p=app-edwardng.git Use tempdir for testing --- diff --git a/t/App-EdwardNG.t b/t/App-EdwardNG.t index 015e054..5531524 100644 --- a/t/App-EdwardNG.t +++ b/t/App-EdwardNG.t @@ -5,10 +5,15 @@ use warnings; use constant KEYID => '34B22806'; use constant EMAIL => 'EdwardNG (Key for testing EdwardNG) '; +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);