aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorMichael Grosser <michael@grosser.it>2015-11-18 12:16:01 -0800
committerMichael Grosser <michael@grosser.it>2015-11-19 20:49:37 -0800
commita8f773b05734b9a798ae9755d280ef95004ec711 (patch)
treea4e2f1bd6870dab03b3cb712ae35da482f427d9f /activesupport/test
parent3d8a7c0e64fef726c22fd64911771cee8c467447 (diff)
downloadrails-a8f773b05734b9a798ae9755d280ef95004ec711.tar.gz
rails-a8f773b05734b9a798ae9755d280ef95004ec711.tar.bz2
rails-a8f773b05734b9a798ae9755d280ef95004ec711.zip
add deprecations for a smooth transition after #22215
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/caching_test.rb27
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