memcached: improve test
This commit is contained in:
parent
b24cbb3ebe
commit
d84a4468c8
1 changed files with 7 additions and 1 deletions
|
@ -57,6 +57,12 @@ class Memcached < Formula
|
|||
end
|
||||
|
||||
test do
|
||||
system "#{bin}/memcached", "-h"
|
||||
pidfile = testpath/"memcached.pid"
|
||||
# Assumes port 11211 is not already taken
|
||||
system bin/"memcached", "--listen=localhost:11211", "--daemon", "--pidfile=#{pidfile}"
|
||||
sleep 1
|
||||
assert_predicate pidfile, :exist?, "Failed to start memcached daemon"
|
||||
pid = (testpath/"memcached.pid").read.chomp.to_i
|
||||
Process.kill "TERM", pid
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue