class Chromedriver < Formula desc "Tool for automated testing of webapps across many browsers" homepage "https://sites.google.com/a/chromium.org/chromedriver/" url "https://chromedriver.storage.googleapis.com/2.27/chromedriver_mac64.zip" version "2.27" sha256 "dffdfb02213c25a090be62f8b95585685f4f57b985af5cacaad3da6342fad207" bottle :unneeded def install bin.install "chromedriver" end plist_options :manual => "chromedriver" 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 exec bin/"chromedriver", "--port=9999", "--log-path=#{testpath}/cd.log" end sleep 5 Process.kill("TERM", driver) File.exist? testpath/"cd.log" end end