Skip to content

Commit

Permalink
airshare: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
nandahkrishna committed Jan 26, 2021
1 parent 6aec37a commit f5d4f5e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Formula/airshare.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ def install

test do
port = free_port
_, _, wait_thr = Open3.popen2 bin/"airshare", "-p", port.to_s, "homebrew-demo", "-t", "Hello Homebrew!"
fork do
exec bin/"airshare", "-p", port.to_s, "homebrew-demo", "-t", "Hello Homebrew!"
end
sleep 5
output = shell_output("#{bin}/airshare -p #{port} homebrew-demo")
assert_equal "Received: Hello Homebrew!\n", output.lines.last
Process.kill("TERM", wait_thr.pid)
output = shell_output("curl -s http://localhost:#{port}/text")
assert_equal "Hello Homebrew!", output.lines.first
end
end

0 comments on commit f5d4f5e

Please sign in to comment.