aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike Naberezny2014-04-18 22:28:57 -0700
committerAdam Vandenberg2014-04-19 08:16:10 -0700
commitf7f8468afe2335c33b883e4ff0b6653ab16b26a2 (patch)
tree81eb9a01375f01c45083953fd2e49de994ac94d4 /Library
parent743e3e86ab67b9a0ca2bdef5f01163511160d6a6 (diff)
downloadhomebrew-f7f8468afe2335c33b883e4ff0b6653ab16b26a2.tar.bz2
xz: add test
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/xz.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/Library/Formula/xz.rb b/Library/Formula/xz.rb
index 08899063b..26c396320 100644
--- a/Library/Formula/xz.rb
+++ b/Library/Formula/xz.rb
@@ -24,4 +24,18 @@ class Xz < Formula
"--prefix=#{prefix}"
system "make install"
end
+
+ test do
+ path = testpath/"data.txt"
+ original_contents = "." * 1000
+ path.write original_contents
+
+ # compress: data.txt -> data.txt.xz
+ system bin/"xz", path
+ assert !path.exist?
+
+ # decompress: data.txt.xz -> data.txt
+ system bin/"xz", "-d", "#{path}.xz"
+ assert_equal original_contents, path.read
+ end
end