From 5c1e55aaa7fc8c33cb317c81db20cc15e724f1d2 Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Wed, 5 Apr 2017 19:32:40 -0400 Subject: [PATCH] privoxy: add test (#12115) --- Formula/privoxy.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Formula/privoxy.rb b/Formula/privoxy.rb index 39413d30c5..dee24a2f04 100644 --- a/Formula/privoxy.rb +++ b/Formula/privoxy.rb @@ -60,4 +60,17 @@ class Privoxy < Formula EOS end + + test do + bind_address = "127.0.0.1:8118" + (testpath/"config").write("listen-address #{bind_address}\n") + begin + server = IO.popen("#{sbin}/privoxy --no-daemon #{testpath}/config") + sleep 1 + assert_match "200 OK", shell_output("/usr/bin/curl -I -x #{bind_address} https://github.com") + ensure + Process.kill("SIGINT", server.pid) + Process.wait(server.pid) + end + end end