class Chromedriver < Formula homepage "https://sites.google.com/a/chromium.org/chromedriver/" url "https://chromedriver.storage.googleapis.com/2.15/chromedriver_mac32.zip" sha256 "37f7ed1cb1bbafd2139486f44c81ebe0b1561c594d2ad2004bd66c3b07453427" version "2.15" def install bin.install "chromedriver" end def plist; <<-EOS.undent Label homebrew.mxcl.chromedriver RunAtLoad KeepAlive ProgramArguments #{opt_bin}/chromedriver ServiceDescription Chrome Driver StandardErrorPath #{var}/log/chromedriver-error.log StandardOutPath #{var}/log/chromedriver-output.log EOS end test do driver = fork do system bin/"chromedriver", "--port=9999", "--log-path=#{testpath}/cd.log" end sleep 5 Process.kill("TERM", driver) File.exist? testpath/"cd.log" end end