From 03189fc8005830d22da8c6f62cf539f49e16001a Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Mon, 4 May 2015 20:53:00 +0100 Subject: [PATCH] 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 --- Formula/mpd.rb | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Formula/mpd.rb b/Formula/mpd.rb index d1d06206c0..c3ad59a78f 100644 --- a/Formula/mpd.rb +++ b/Formula/mpd.rb @@ -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 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