Merge pull request #48083 from bayandin/ungit-fix-test

ungit: fix test on Mojave
This commit is contained in:
Alexander Bayandin 2019-12-23 11:20:37 +00:00 committed by GitHub
parent 804de37cf1
commit 73104e7486
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,8 +21,6 @@ class Ungit < Formula
end end
test do test do
require "nokogiri"
server = TCPServer.new(0) server = TCPServer.new(0)
port = server.addr[1] port = server.addr[1]
server.close server.close
@ -31,7 +29,7 @@ class Ungit < Formula
exec bin/"ungit", "--no-launchBrowser", "--port=#{port}", "--autoShutdownTimeout=6000" exec bin/"ungit", "--no-launchBrowser", "--port=#{port}", "--autoShutdownTimeout=6000"
end end
sleep 5 sleep 5
assert_match "ungit", Nokogiri::HTML(shell_output("curl -s 127.0.0.1:#{port}/")).at_css("title").text assert_includes shell_output("curl -s 127.0.0.1:#{port}/"), "<title>ungit</title>"
ensure ensure
if ppid if ppid
Process.kill("TERM", ppid) Process.kill("TERM", ppid)