diff options
-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 |