mpd: add test & install example conf file

Follow up to Homebrew/homebrew#39353. The test should ensure we catch the need to
bump in future.

Closes Homebrew/homebrew#39360.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Dominyk Tiller 2015-05-04 20:53:00 +01:00 committed by Mike McQuaid
parent 5977b3d120
commit 03189fc800

View file

@ -4,7 +4,7 @@ class Mpd < Formula
stable do
url "http://www.musicpd.org/download/mpd/0.19/mpd-0.19.9.tar.xz"
sha1 "6683bee5f132eda318c5a61ec14b2df8d9164d60"
sha256 "47851423053cd38cfad65be5985b41b7cd5bdbe8d0d13378e11748a28b19f26f"
end
bottle do
@ -70,6 +70,7 @@ class Mpd < Formula
--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--sysconfdir=#{etc}
--enable-bzip2
--enable-ffmpeg
--enable-fluidsynth
@ -89,7 +90,9 @@ class Mpd < Formula
system "./configure", *args
system "make"
ENV.j1 # Directories are created in parallel, so let's not do that
system "make install"
system "make", "install"
(etc+"mpd").install "doc/mpdconf.example" => "mpd.conf"
end
plist_options :manual => "mpd"
@ -116,4 +119,18 @@ class Mpd < Formula
</plist>
EOS
end
test do
pid = fork do
exec "#{bin}/mpd --stdout --no-daemon --no-config"
end
sleep 2
begin
assert_match /OK MPD/, shell_output("curl localhost:6600")
ensure
Process.kill("SIGINT", pid)
Process.wait(pid)
end
end
end