aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorBaptiste Fontaine2015-03-28 22:23:36 +0100
committerBrett Koonce2015-03-28 23:08:09 -0700
commit08471c185e347e8d7198cdad333e639ef5ff894e (patch)
tree43d37aa23ffa011aabeca9a1a1684b590493f9c7 /Library
parent017f7f9b0ed9bc873882013d5225bbf3c2bf648e (diff)
downloadhomebrew-08471c185e347e8d7198cdad333e639ef5ff894e.tar.bz2
gengetopt: add test
Closes #38157. Signed-off-by: Brett Koonce <koonce@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/gengetopt.rb27
1 files changed, 20 insertions, 7 deletions
diff --git a/Library/Formula/gengetopt.rb b/Library/Formula/gengetopt.rb
index 900e94f43..65e2b137b 100644
--- a/Library/Formula/gengetopt.rb
+++ b/Library/Formula/gengetopt.rb
@@ -1,10 +1,8 @@
-require 'formula'
-
class Gengetopt < Formula
- homepage 'http://www.gnu.org/software/gengetopt/'
- url 'http://ftpmirror.gnu.org/gengetopt/gengetopt-2.22.6.tar.gz'
- mirror 'http://ftp.gnu.org/gnu/gengetopt/gengetopt-2.22.6.tar.gz'
- sha1 'c93bdec17f247aa32b3cd6530a6f68aa430d67f5'
+ homepage "https://www.gnu.org/software/gengetopt/"
+ url "http://ftpmirror.gnu.org/gengetopt/gengetopt-2.22.6.tar.gz"
+ mirror "https://ftp.gnu.org/gnu/gengetopt/gengetopt-2.22.6.tar.gz"
+ sha256 "30b05a88604d71ef2a42a2ef26cd26df242b41f5b011ad03083143a31d9b01f7"
def install
system "./configure", "--disable-dependency-tracking",
@@ -12,6 +10,21 @@ class Gengetopt < Formula
"--mandir=#{man}"
ENV.deparallelize
- system "make install"
+ system "make", "install"
+ end
+
+ test do
+ ggo = <<-EOS.undent
+ package "homebrew"
+ version "0.9.5"
+ purpose "The missing package manager for OS X"
+
+ option "verbose" v "be verbose"
+ EOS
+
+ pipe_output("#{bin}/gengetopt --file-name=test", ggo, 0)
+ assert File.exist? "test.h"
+ assert File.exist? "test.c"
+ assert_match(/verbose_given/, File.read("test.h"))
end
end