From ea123e767df67cb80b6b54ddad210ddc02ab37f6 Mon Sep 17 00:00:00 2001 From: Ted Pennings Date: Tue, 14 Jan 2014 23:05:39 -0500 Subject: openssl: a test using checksums Closes #25913. Signed-off-by: Mike McQuaid --- Library/Formula/openssl.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Library/Formula') 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 -- cgit v1.2.3