bcrypt: add test

Closes Homebrew/homebrew#35391.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Xu Cheng 2014-12-31 20:33:24 +08:00 committed by Mike McQuaid
parent cf505dca77
commit b5dfeba29c

View file

@ -10,4 +10,12 @@ class Bcrypt < Formula
bin.install "bcrypt"
man1.install gzip("bcrypt.1")
end
test do
(testpath/"test.txt").write("Hello World!")
pipe_output("#{bin}/bcrypt -r test.txt", "12345678\n12345678\n")
mv "test.txt.bfe", "test.out.txt.bfe"
pipe_output("#{bin}/bcrypt -r test.out.txt.bfe", "12345678\n")
assert_equal File.read("test.txt"), File.read("test.out.txt")
end
end