From 0c8e9fd02645225834cbb421c3f574ba0e3e4baf Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Wed, 31 Dec 2014 20:33:24 +0800 Subject: bcrypt: add test Closes #35391. Signed-off-by: Mike McQuaid --- Library/Formula/bcrypt.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Library/Formula') diff --git a/Library/Formula/bcrypt.rb b/Library/Formula/bcrypt.rb index cdc68dafd..311250ee1 100644 --- a/Library/Formula/bcrypt.rb +++ b/Library/Formula/bcrypt.rb @@ -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 -- cgit v1.2.3