aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/sary.rb
diff options
context:
space:
mode:
authorBaptiste Fontaine2015-04-06 22:56:53 +0200
committerTim D. Smith2015-04-06 21:01:21 -0700
commitcbc82945e0db9ce326e839402e3d947952b4d74a (patch)
tree1128b815da16052141cd4b16a44e4f5421bfadcf /Library/Formula/sary.rb
parentb1f5dd1647882d3c7687725c31fd42e6e65b191e (diff)
downloadhomebrew-cbc82945e0db9ce326e839402e3d947952b4d74a.tar.bz2
sary: test added
Closes #38417. Signed-off-by: Tim D. Smith <git@tim-smith.us>
Diffstat (limited to 'Library/Formula/sary.rb')
-rw-r--r--Library/Formula/sary.rb29
1 files changed, 21 insertions, 8 deletions
diff --git a/Library/Formula/sary.rb b/Library/Formula/sary.rb
index d1a9de9e7..e88779922 100644
--- a/Library/Formula/sary.rb
+++ b/Library/Formula/sary.rb
@@ -1,16 +1,29 @@
-require 'formula'
-
class Sary < Formula
- homepage 'http://sary.sourceforge.net/'
- url 'http://sary.sourceforge.net/sary-1.2.0.tar.gz'
- sha1 'cfc671ca99d58df4ed8985408499f96579af18f3'
+ homepage "http://sary.sourceforge.net/"
+ url "http://sary.sourceforge.net/sary-1.2.0.tar.gz"
+ sha256 "d4b16e32c97a253b546922d2926c8600383352f0af0d95e2938b6d846dfc6a11"
- depends_on 'pkg-config' => :build
- depends_on 'glib'
+ depends_on "pkg-config" => :build
+ depends_on "glib"
def install
system "./configure", "--prefix=#{prefix}",
"--mandir=#{man}"
- system "make install"
+ system "make", "install"
+ end
+
+ test do
+ (testpath/"test").write <<-EOS.undent
+ Some text,
+ this is the Sary formula, a suffix array library and tools,
+ more text.
+ more. text.
+ EOS
+
+ system "#{bin}/mksary", "test"
+ assert File.exist? "test.ary"
+
+ assert_equal "Some text,\nmore text.\nmore. text.",
+ shell_output("#{bin}/sary text test").chomp
end
end