aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorTed Pennings2014-01-14 23:05:39 -0500
committerMike McQuaid2014-01-15 09:08:47 +0000
commitea123e767df67cb80b6b54ddad210ddc02ab37f6 (patch)
tree7a7861fccc8fb692ce83558151b6b7ed7c833b2a /Library
parent13f99ce9efd828cde0eb5d7c335c756bc858b14c (diff)
downloadhomebrew-ea123e767df67cb80b6b54ddad210ddc02ab37f6.tar.bz2
openssl: a test using checksums
Closes #25913. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/openssl.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Formula/openssl.rb b/Library/Formula/openssl.rb
index 701b279d4..9e63462cd 100644
--- a/Library/Formula/openssl.rb
+++ b/Library/Formula/openssl.rb
@@ -78,4 +78,14 @@ class Openssl < Formula
openssldir.install_symlink 'osx_cert.pem' => 'cert.pem'
end
end
+
+ test do
+ (testpath/'testfile.txt').write("This is a test file")
+ expected_checksum = "91b7b0b1e27bfbf7bc646946f35fa972c47c2d32"
+ system "#{bin}/openssl", 'dgst', '-sha1', '-out', 'checksum.txt', 'testfile.txt'
+ open("checksum.txt") do |f|
+ checksum = f.read(100).split("=").last.strip
+ assert_equal checksum, expected_checksum
+ end
+ end
end