Created
November 14, 2011 15:34
-
-
Save nagachika/1364187 to your computer and use it in GitHub Desktop.
patch for openssl test to suppress message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/test/openssl/test_engine.rb b/test/openssl/test_engine.rb | |
index fce5f76..db80521 100644 | |
--- a/test/openssl/test_engine.rb | |
+++ b/test/openssl/test_engine.rb | |
@@ -41,6 +41,10 @@ class OpenSSL::TestEngine < Test::Unit::TestCase | |
end | |
def test_openssl_engine_cipher_rc4 | |
+ # suppress message from OpenSSL | |
+ tmpfile = Tempfile.new("openssl_cipher_rc4") | |
+ stderr_back = $stderr.dup | |
+ $stderr.reopen(tmpfile) | |
engine = OpenSSL::Engine.by_id("openssl") | |
algo = "RC4" #AES is not supported by openssl Engine (<=1.0.0e) | |
data = "a" * 1000 | |
@@ -59,6 +63,10 @@ class OpenSSL::TestEngine < Test::Unit::TestCase | |
assert_equal(data, decrypted) | |
cleanup | |
+ ensure | |
+ if stderr_back | |
+ $stderr.reopen(stderr_back) | |
+ end | |
end | |
private |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment