From 4fdf6ec46ace530691dfbf1dfcc0213ae6a2825e Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Fri, 12 Dec 2014 09:48:43 +0100 Subject: aescrypt: add test. Closes #34916. Signed-off-by: Mike McQuaid --- Library/Formula/aescrypt.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Library/Formula') diff --git a/Library/Formula/aescrypt.rb b/Library/Formula/aescrypt.rb index 2e74b08f6..179a0cda6 100644 --- a/Library/Formula/aescrypt.rb +++ b/Library/Formula/aescrypt.rb @@ -8,6 +8,18 @@ class Aescrypt < Formula def install system "./configure" system "make" - bin.install 'aescrypt', 'aesget' + bin.install "aescrypt", "aesget" + end + + test do + (testpath/"key").write "kk=12345678901234567890123456789abc0" + + require "open3" + Open3.popen3("#{bin}/aescrypt", "-k", testpath/"key") do |stdin, stdout, _| + stdin.write("hello") + stdin.close + # we can't predict the output + stdout.read.length > 0 + end end end -- cgit v1.2.3