diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2015-11-20 04:11:56 -0200 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2015-11-20 04:11:56 -0200 |
commit | f6d12b8ea235e5b9c1d23edbff88765d7882ce94 (patch) | |
tree | 00d4419f9d3671541f9b6c110076ed0ba2b9a2b3 /activesupport/test | |
parent | eb9d4723f297b74cea3985c4a5685badb6fb758d (diff) | |
parent | a8f773b05734b9a798ae9755d280ef95004ec711 (diff) | |
download | rails-f6d12b8ea235e5b9c1d23edbff88765d7882ce94.tar.gz rails-f6d12b8ea235e5b9c1d23edbff88765d7882ce94.tar.bz2 rails-f6d12b8ea235e5b9c1d23edbff88765d7882ce94.zip |
Merge pull request #22332 from grosser/grosser/deprecation
add deprecations for a smooth transition after #22215
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/caching_test.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index 3f9682231f..7bef73136c 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -518,6 +518,12 @@ module CacheStoreBehavior ensure ActiveSupport::Notifications.unsubscribe "cache_read.active_support" end + + def test_can_call_deprecated_namesaced_key + assert_deprecated "`namespaced_key` is deprecated" do + @cache.send(:namespaced_key, 111, {}) + end + end end # https://rails.lighthouseapp.com/projects/8994/tickets/6225-memcachestore-cant-deal-with-umlauts-and-special-characters @@ -693,6 +699,15 @@ module LocalCacheBehavior app = @cache.middleware.new(app) app.call({}) end + + def test_can_call_deprecated_set_cache_value + @cache.with_local_cache do + assert_deprecated "`set_cache_value` is deprecated" do + @cache.send(:set_cache_value, 1, 'foo', :ignored, {}) + end + assert_equal 1, @cache.read('foo') + end + end end module AutoloadingCacheBehavior @@ -858,6 +873,12 @@ class FileStoreTest < ActiveSupport::TestCase @cache.write(1, nil) assert_equal false, @cache.write(1, "aaaaaaaaaa", unless_exist: true) end + + def test_can_call_deprecated_key_file_path + assert_deprecated "`key_file_path` is deprecated" do + assert_equal 111, @cache.send(:key_file_path, 111) + end + end end class MemoryStoreTest < ActiveSupport::TestCase @@ -1032,6 +1053,12 @@ class MemCacheStoreTest < ActiveSupport::TestCase value << 'bingo' assert_not_equal value, @cache.read('foo') end + + def test_can_call_deprecated_escape_key + assert_deprecated "`escape_key` is deprecated" do + assert_equal 111, @cache.send(:escape_key, 111) + end + end end class NullStoreTest < ActiveSupport::TestCase |