From 24b116261ce6ab30b5641dbbf505304163e324c3 Mon Sep 17 00:00:00 2001 From: Dustin Rodrigues Date: Wed, 15 Jul 2020 03:25:55 -0400 Subject: [PATCH] minidlna: use free_port helper (#57982) --- Formula/minidlna.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Formula/minidlna.rb b/Formula/minidlna.rb index 04f37a6b9608..1f204072f170 100644 --- a/Formula/minidlna.rb +++ b/Formula/minidlna.rb @@ -102,14 +102,12 @@ def plist log_dir=#{testpath}/.config/minidlna EOS - system sbin/"minidlnad", "-f", "minidlna.conf", "-p", "8081", "-P", + port = free_port + + system sbin/"minidlnad", "-f", "minidlna.conf", "-p", port.to_s, "-P", testpath/"minidlna.pid" sleep 2 - begin - assert_match /MiniDLNA #{version}/, shell_output("curl localhost:8081") - ensure - Process.kill("SIGINT", File.read("minidlna.pid").to_i) - end + assert_match /MiniDLNA #{version}/, shell_output("curl localhost:#{port}") end end