@@ -518,6 +518,12 @@ def test_cache_miss_instrumentation
518518 ensure
519519 ActiveSupport ::Notifications . unsubscribe "cache_read.active_support"
520520 end
521+
522+ def test_can_call_deprecated_namesaced_key
523+ assert_deprecated "`namespaced_key` is deprecated" do
524+ @cache . send ( :namespaced_key , 111 , { } )
525+ end
526+ end
521527end
522528
523529# https://rails.lighthouseapp.com/projects/8994/tickets/6225-memcachestore-cant-deal-with-umlauts-and-special-characters
@@ -693,6 +699,15 @@ def test_middleware
693699 app = @cache . middleware . new ( app )
694700 app . call ( { } )
695701 end
702+
703+ def test_can_call_deprecated_set_cache_value
704+ @cache . with_local_cache do
705+ assert_deprecated "`set_cache_value` is deprecated" do
706+ @cache . send ( :set_cache_value , 1 , 'foo' , :ignored , { } )
707+ end
708+ assert_equal 1 , @cache . read ( 'foo' )
709+ end
710+ end
696711end
697712
698713module AutoloadingCacheBehavior
@@ -858,6 +873,12 @@ def test_write_with_unless_exist
858873 @cache . write ( 1 , nil )
859874 assert_equal false , @cache . write ( 1 , "aaaaaaaaaa" , unless_exist : true )
860875 end
876+
877+ def test_can_call_deprecated_key_file_path
878+ assert_deprecated "`key_file_path` is deprecated" do
879+ assert_equal 111 , @cache . send ( :key_file_path , 111 )
880+ end
881+ end
861882end
862883
863884class MemoryStoreTest < ActiveSupport ::TestCase
@@ -1032,6 +1053,12 @@ def test_read_should_return_a_different_object_id_each_time_it_is_called
10321053 value << 'bingo'
10331054 assert_not_equal value , @cache . read ( 'foo' )
10341055 end
1056+
1057+ def test_can_call_deprecated_escape_key
1058+ assert_deprecated "`escape_key` is deprecated" do
1059+ assert_equal 111 , @cache . send ( :escape_key , 111 )
1060+ end
1061+ end
10351062end
10361063
10371064class NullStoreTest < ActiveSupport ::TestCase
0 commit comments