From 6ddb32e14d96170c6ae57910f7cd35f5f1b67dc8 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Mon, 19 Jan 2015 13:55:11 +0800 Subject: gpg: add test Closes #36018. Signed-off-by: Mike McQuaid --- Library/Formula/gnupg.rb | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'Library/Formula') 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 -- cgit v1.2.3