aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorXu Cheng2015-01-19 13:55:11 +0800
committerMike McQuaid2015-01-19 18:33:11 +0100
commit6ddb32e14d96170c6ae57910f7cd35f5f1b67dc8 (patch)
treecc9cdcb7c03e3fce0632efa41dacb2eb06065bbf /Library/Formula
parent4bb9eb891653197fe7f4fb6a30e00cbbb2435278 (diff)
downloadhomebrew-6ddb32e14d96170c6ae57910f7cd35f5f1b67dc8.tar.bz2
gpg: add test
Closes #36018. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/gnupg.rb22
1 files changed, 18 insertions, 4 deletions
diff --git a/Library/Formula/gnupg.rb b/Library/Formula/gnupg.rb
index b39d20d63..308aae5dc 100644
--- a/Library/Formula/gnupg.rb
+++ b/Library/Formula/gnupg.rb
@@ -1,5 +1,3 @@
-require "formula"
-
class Gnupg < Formula
homepage "http://www.gnupg.org/"
url "ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.18.tar.bz2"
@@ -22,11 +20,27 @@ class Gnupg < Formula
"--prefix=#{prefix}",
"--disable-asm"
system "make"
- system "make check"
+ system "make", "check"
# we need to create these directories because the install target has the
# dependency order wrong
[bin, libexec/"gnupg"].each(&:mkpath)
- system "make install"
+ system "make", "install"
+ end
+
+ test do
+ (testpath/"gen-key-script").write <<-EOS.undent
+ Key-Type: RSA
+ Key-Length: 4096
+ Subkey-Type: RSA
+ Subkey-Length: 4096
+ Name-Real: Homebrew Test
+ Name-Email: test@example.com
+ Expire-Date: 0
+ EOS
+ system "#{bin}/gpg", "--batch", "--gen-key", "gen-key-script"
+ (testpath/"test.txt").write ("Hello World!")
+ system "#{bin}/gpg", "--armor", "--sign", "test.txt"
+ system "#{bin}/gpg", "--verify", "test.txt.asc"
end
end