From d3d1b4d224193b3e2a770b9a0255a0a97292d850 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 6 May 2016 09:29:20 -0400 Subject: [PATCH] duff: Add test. Compares two equal files and asserts expected output. --- Formula/duff.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Formula/duff.rb b/Formula/duff.rb index 90f3c9f553..c7170be390 100644 --- a/Formula/duff.rb +++ b/Formula/duff.rb @@ -17,4 +17,17 @@ class Duff < Formula "--mandir=#{man}" system "make", "install" end + + test do + expected = <<-EOS.undent + 2 files in cluster 1 (6 bytes, digest 8843d7f92416211de9ebb963ff4ce28125932878) + cmp1 + cmp2 + EOS + + (testpath/"cmp1").write "foobar" + (testpath/"cmp2").write "foobar" + + assert_equal expected, shell_output("#{bin}/duff cmp1 cmp2") + end end