aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/gpg.rb
diff options
context:
space:
mode:
authorDominyk Tiller2017-08-28 16:51:58 +0100
committerDominyk Tiller2017-09-01 01:43:52 +0100
commit380afe2f2df9c4b341484571dc1b2d2d54f7400b (patch)
tree313d4be711aeeb61a90ca37116962f598b9b8027 /Library/Homebrew/gpg.rb
parentb38d811673677dab387e15db58919e902299e993 (diff)
downloadbrew-380afe2f2df9c4b341484571dc1b2d2d54f7400b.tar.bz2
gpg: test usability tweaks
Diffstat (limited to 'Library/Homebrew/gpg.rb')
-rw-r--r--Library/Homebrew/gpg.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/Library/Homebrew/gpg.rb b/Library/Homebrew/gpg.rb
index b9a6942ec..a63207e6c 100644
--- a/Library/Homebrew/gpg.rb
+++ b/Library/Homebrew/gpg.rb
@@ -37,12 +37,21 @@ class Gpg
Key-Length: 2048
Subkey-Type: RSA
Subkey-Length: 2048
- Passphrase: ''
Name-Real: Testing
Name-Email: testing@foo.bar
Expire-Date: 1d
+ %no-protection
%commit
EOS
system GPG_EXECUTABLE, "--batch", "--gen-key", "batch.gpg"
end
+
+ def self.cleanup_test_processes!
+ odie "No GPG present to test against!" unless available?
+ gpgconf = Pathname.new(GPG_EXECUTABLE).parent/"gpgconf"
+
+ system gpgconf, "--kill", "gpg-agent"
+ system gpgconf, "--homedir", "keyrings/live", "--kill",
+ "gpg-agent"
+ end
end