Skip to content

Commit

Permalink
Update tests to show example with OpenSSL
Browse files Browse the repository at this point in the history
  • Loading branch information
dbussink committed Jan 5, 2021
1 parent f5f7c05 commit 658e15f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/backend/cache_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'test_helper'
require 'digest/md5'
require 'openssl'

begin
require 'active_support'
Expand Down Expand Up @@ -74,11 +74,11 @@ def teardown
end

test "cache_key uses configured digest method" do
md5 = Digest::MD5.new
digest = OpenSSL::Digest::SHA256.new
options = { :bar => 1 }
options_hash = options.inspect
with_cache_key_digest(md5) do
assert_equal "i18n//en/#{md5.hexdigest(:foo.to_s)}/#{md5.hexdigest(options_hash)}", I18n.backend.send(:cache_key, :en, :foo, options)
with_cache_key_digest(digest) do
assert_equal "i18n//en/#{digest.hexdigest(:foo.to_s)}/#{digest.hexdigest(options_hash)}", I18n.backend.send(:cache_key, :en, :foo, options)
end
end

Expand Down

0 comments on commit 658e15f

Please sign in to comment.