diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2014-12-04 07:37:48 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2014-12-04 07:37:48 -0200 |
commit | 21cff02a9c4add719ed7cef0d92793fd2f624c0f (patch) | |
tree | cd787358ab69585093a834b86e38dd954898e835 | |
parent | 9e0dab64d8f92248f9d47023debf0d7b375a6800 (diff) | |
parent | e428ddececf43923dec4299c40b29451e5bea80d (diff) | |
download | rails-21cff02a9c4add719ed7cef0d92793fd2f624c0f.tar.gz rails-21cff02a9c4add719ed7cef0d92793fd2f624c0f.tar.bz2 rails-21cff02a9c4add719ed7cef0d92793fd2f624c0f.zip |
Merge pull request #17903 from claudiob/remove-rescue-openssl
Remove "rescue" clause around "require 'openssl'"
-rw-r--r-- | actionpack/test/dispatch/cookies_test.rb | 11 | ||||
-rw-r--r-- | activesupport/test/message_encryptor_test.rb | 11 | ||||
-rw-r--r-- | activesupport/test/message_verifier_test.rb | 15 |
3 files changed, 5 insertions, 32 deletions
diff --git a/actionpack/test/dispatch/cookies_test.rb b/actionpack/test/dispatch/cookies_test.rb index 5be75a5de6..9384c09454 100644 --- a/actionpack/test/dispatch/cookies_test.rb +++ b/actionpack/test/dispatch/cookies_test.rb @@ -1,12 +1,5 @@ require 'abstract_unit' - -begin - require 'openssl' - OpenSSL::PKCS5 -rescue LoadError, NameError - $stderr.puts "Skipping KeyGenerator test: broken OpenSSL install" -else - +require 'openssl' require 'active_support/key_generator' require 'active_support/message_verifier' @@ -1155,5 +1148,3 @@ class CookiesTest < ActionController::TestCase end end end - -end diff --git a/activesupport/test/message_encryptor_test.rb b/activesupport/test/message_encryptor_test.rb index b6c0a08b05..eb71369397 100644 --- a/activesupport/test/message_encryptor_test.rb +++ b/activesupport/test/message_encryptor_test.rb @@ -1,12 +1,5 @@ require 'abstract_unit' - -begin - require 'openssl' - OpenSSL::Digest::SHA1 -rescue LoadError, NameError - $stderr.puts "Skipping MessageEncryptor test: broken OpenSSL install" -else - +require 'openssl' require 'active_support/time' require 'active_support/json' @@ -97,5 +90,3 @@ class MessageEncryptorTest < ActiveSupport::TestCase ::Base64.strict_encode64(bits) end end - -end diff --git a/activesupport/test/message_verifier_test.rb b/activesupport/test/message_verifier_test.rb index 68f40fbb28..6c3519df9a 100644 --- a/activesupport/test/message_verifier_test.rb +++ b/activesupport/test/message_verifier_test.rb @@ -1,12 +1,5 @@ require 'abstract_unit' - -begin - require 'openssl' - OpenSSL::Digest::SHA1 -rescue LoadError, NameError - $stderr.puts "Skipping MessageVerifier test: broken OpenSSL install" -else - +require 'openssl' require 'active_support/time' require 'active_support/json' @@ -41,11 +34,11 @@ class MessageVerifierTest < ActiveSupport::TestCase assert_equal @data, @verifier.verified(message) assert_equal @data, @verifier.verify(message) end - + def test_verified_returns_false_on_invalid_message assert !@verifier.verified("purejunk") end - + def test_verify_exception_on_invalid_message assert_raise(ActiveSupport::MessageVerifier::InvalidSignature) do @verifier.verify("purejunk") @@ -90,5 +83,3 @@ class MessageVerifierTest < ActiveSupport::TestCase assert_equal exception.message, 'Secret should not be nil.' end end - -end |