aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-01-12 21:16:16 +0800
committerMike McQuaid2015-01-12 14:25:57 +0000
commit2f741f6e47910b1e6c81006b4b7e304bec49e621 (patch)
tree50a85585960e76688f606f06a886e0168394922c /Library
parentbba75ccb171b99dcb0aca52be1235290ca38c4b2 (diff)
downloadhomebrew-2f741f6e47910b1e6c81006b4b7e304bec49e621.tar.bz2
entr: add test and modernize
Closes #35780. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/entr.rb23
1 files changed, 15 insertions, 8 deletions
diff --git a/Library/Formula/entr.rb b/Library/Formula/entr.rb
index ba1db13fe..aede256f9 100644
--- a/Library/Formula/entr.rb
+++ b/Library/Formula/entr.rb
@@ -1,9 +1,7 @@
-require 'formula'
-
class Entr < Formula
- homepage 'http://entrproject.org/'
- url 'http://entrproject.org/code/entr-3.0.tar.gz'
- sha1 'e7c5f589b2bce839464052b116a051b4d8f43f23'
+ homepage "http://entrproject.org/"
+ url "http://entrproject.org/code/entr-3.0.tar.gz"
+ sha1 "e7c5f589b2bce839464052b116a051b4d8f43f23"
bottle do
cellar :any
@@ -13,10 +11,19 @@ class Entr < Formula
end
def install
- ENV['PREFIX'] = prefix
- ENV['MANPREFIX'] = man
+ ENV["PREFIX"] = prefix
+ ENV["MANPREFIX"] = man
system "./configure"
system "make"
- system "make install"
+ system "make", "install"
+ end
+
+ test do
+ touch testpath/"test.1"
+ fork do
+ sleep 0.5
+ touch testpath/"test.2"
+ end
+ assert_equal "New File", pipe_output("#{bin}/entr -d echo 'New File'", testpath).strip
end
end