From 256acf95164d6af5affa368bda97fe0aedcc1c47 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Tue, 10 Mar 2015 21:14:14 +0800 Subject: mmv: add test Closes #37563. Signed-off-by: Xu Cheng --- Library/Formula/mmv.rb | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'Library') diff --git a/Library/Formula/mmv.rb b/Library/Formula/mmv.rb index 05107ff3c..3b70a3698 100644 --- a/Library/Formula/mmv.rb +++ b/Library/Formula/mmv.rb @@ -1,25 +1,31 @@ -require 'formula' - class Mmv < Formula - homepage 'http://packages.debian.org/unstable/utils/mmv' - url "http://mirrors.kernel.org/debian/pool/main/m/mmv/mmv_1.01b.orig.tar.gz" - mirror 'http://ftp.us.debian.org/debian/pool/main/m/mmv/mmv_1.01b.orig.tar.gz' - sha1 '538a26b1d7e8b9bc286843e6aa2d8d959d8914bb' + homepage "https://packages.debian.org/unstable/utils/mmv" + url "https://mirrors.kernel.org/debian/pool/main/m/mmv/mmv_1.01b.orig.tar.gz" + mirror "http://ftp.us.debian.org/debian/pool/main/m/mmv/mmv_1.01b.orig.tar.gz" + sha256 "0399c027ea1e51fd607266c1e33573866d4db89f64a74be8b4a1d2d1ff1fdeef" patch do url "http://ftp.us.debian.org/debian/pool/main/m/mmv/mmv_1.01b-15.diff.gz" - sha1 "101f42c641472c7fc1f2c2f7ef391c032cdbe3c0" + sha256 "9ad3e3d47510f816b4a18bae04ea75913588eec92248182f85dd09bc5ad2df13" end def install system "make", "CC=#{ENV.cc}", "LDFLAGS=" - bin.install 'mmv' - man1.install 'mmv.1' + bin.install "mmv" + man1.install "mmv.1" %w[mcp mad mln].each do |mxx| bin.install_symlink "mmv" => mxx man1.install_symlink "mmv.1" => "#{mxx}.1" end end + + test do + touch testpath/"a" + touch testpath/"b" + pipe_output(bin/"mmv", "a b\nb c\n") + assert !(testpath/"a").exist? + assert (testpath/"c").exist? + end end -- cgit v1.2.3