From dfc746637cf87a7f04ca92e2f8b70afa33f8d7ec Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Wed, 18 Mar 2015 20:18:33 +0100 Subject: timelimit: add test Closes #37840. Signed-off-by: Brett Koonce --- Library/Formula/timelimit.rb | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'Library') diff --git a/Library/Formula/timelimit.rb b/Library/Formula/timelimit.rb index cd975a711..f3f4dd9df 100644 --- a/Library/Formula/timelimit.rb +++ b/Library/Formula/timelimit.rb @@ -1,15 +1,24 @@ -require 'formula' - class Timelimit < Formula - homepage 'http://devel.ringlet.net/sysutils/timelimit/' - url 'http://devel.ringlet.net/sysutils/timelimit/timelimit-1.8.tar.gz' - sha1 '0bc20606db0f587f3927f747680c9522b2d4c5af' + homepage "http://devel.ringlet.net/sysutils/timelimit/" + url "http://devel.ringlet.net/sysutils/timelimit/timelimit-1.8.tar.gz" + sha256 "026e72b345f8407ebaa002036fd785b2136b2dfc4f8854f14536196ee3079996" def install - system "make", "LOCALBASE=#{prefix}", - "MANDIR=#{man}/man", - "all" - bin.install "timelimit" - man1.install "timelimit.1.gz" + # don't install for a specific user + inreplace "Makefile", "-o ${BINOWN} -g ${BINGRP}", "" + inreplace "Makefile", "-o ${MANOWN} -g ${MANGRP}", "" + + args = %W[LOCALBASE=#{prefix} MANDIR=#{man}/man] + + check_args = args + ["check"] + install_args = args + ["install"] + + system "make", *check_args + system "make", *install_args + end + + test do + assert_equal "timelimit: sending warning signal 15", + shell_output("#{bin}/timelimit -p -t 1 sleep 5 2>&1", 143).chomp end end -- cgit v1.2.3