quilt: add test

Closes Homebrew/homebrew#35496.
This commit is contained in:
Xu Cheng 2015-01-03 16:37:43 +08:00 committed by Mike McQuaid
parent 19e38f6c02
commit 4216ab6ee6

View file

@ -19,4 +19,16 @@ class Quilt < Formula
system "make"
system "make", "install"
end
test do
mkdir "patches"
(testpath/"test.txt").write "Hello, World!"
system "#{bin}/quilt", "new", "test.patch"
system "#{bin}/quilt", "add", "test.txt"
rm "test.txt"
(testpath/"test.txt").write "Hi!"
system "#{bin}/quilt", "refresh"
assert_match /-Hello, World!/, File.read("patches/test.patch")
assert_match /\+Hi!/, File.read("patches/test.patch")
end
end