pass: update test

This commit is contained in:
ilovezfs 2017-04-03 01:03:33 -07:00
parent f5a647487d
commit 72fccb6d54

View file

@ -25,9 +25,24 @@ class Pass < Formula
end end
test do test do
Gpg.create_test_key(testpath) (testpath/"batch.gpg").write <<-EOS.undent
system bin/"pass", "init", "Testing" Key-Type: RSA
system bin/"pass", "generate", "Email/testing@foo.bar", "15" Key-Length: 2048
assert File.exist?(".password-store/Email/testing@foo.bar.gpg") Subkey-Type: RSA
Subkey-Length: 2048
Name-Real: Testing
Name-Email: testing@foo.bar
Expire-Date: 1d
%no-protection
%commit
EOS
begin
system Formula["gnupg"].opt_bin/"gpg", "--batch", "--gen-key", "batch.gpg"
system bin/"pass", "init", "Testing"
system bin/"pass", "generate", "Email/testing@foo.bar", "15"
assert File.exist?(".password-store/Email/testing@foo.bar.gpg")
ensure
system Formula["gnupg"].opt_bin/"gpgconf", "--kill", "gpg-agent"
end
end end
end end