From ead8a57915e018eba65838398a0e1b46d9836919 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Wed, 25 Mar 2015 22:18:39 +0100 Subject: cdb: test added Closes #38076. Signed-off-by: Xu Cheng --- Library/Formula/cdb.rb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'Library') diff --git a/Library/Formula/cdb.rb b/Library/Formula/cdb.rb index d386e0d01..63ee803c1 100644 --- a/Library/Formula/cdb.rb +++ b/Library/Formula/cdb.rb @@ -1,12 +1,18 @@ -require 'formula' - class Cdb < Formula - homepage 'http://cr.yp.to/cdb.html' - url 'http://cr.yp.to/cdb/cdb-0.75.tar.gz' - sha1 '555749be5b2617e29e44b5326a2536813d62c248' + homepage "http://cr.yp.to/cdb.html" + url "http://cr.yp.to/cdb/cdb-0.75.tar.gz" + sha256 "1919577799a50c080a8a05a1cbfa5fa7e7abc823d8d7df2eeb181e624b7952c5" def install inreplace "conf-home", "/usr/local", prefix - system "make setup" + system "make", "setup" + end + + test do + record = "+4,8:test->homebrew\n\n" + pipe_output("#{bin}/cdbmake db dbtmp", record, 0) + assert File.exist? "db" + assert_equal(record, + pipe_output("#{bin}/cdbdump", (testpath/"db").binread, 0)) end end -- cgit v1.2.3