privoxy: add test (#12115)

This commit is contained in:
Zhiming Wang 2017-04-05 19:32:40 -04:00 committed by ilovezfs
parent 4d35d06aeb
commit 5c1e55aaa7

View file

@ -60,4 +60,17 @@ class Privoxy < Formula
</plist>
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