aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/cache/behaviors/cache_store_behavior.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/cache/behaviors/cache_store_behavior.rb')
-rw-r--r--activesupport/test/cache/behaviors/cache_store_behavior.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/activesupport/test/cache/behaviors/cache_store_behavior.rb b/activesupport/test/cache/behaviors/cache_store_behavior.rb
index f9153ffe2a..e17c09ba39 100644
--- a/activesupport/test/cache/behaviors/cache_store_behavior.rb
+++ b/activesupport/test/cache/behaviors/cache_store_behavior.rb
@@ -52,6 +52,13 @@ module CacheStoreBehavior
end
end
+ def test_fetch_cache_miss_with_skip_nil
+ assert_not_called(@cache, :write) do
+ assert_nil @cache.fetch("foo", skip_nil: true) { nil }
+ assert_equal false, @cache.exist?("foo")
+ end
+ end
+
def test_fetch_with_forced_cache_miss_with_block
@cache.write("foo", "bar")
assert_equal "foo_bar", @cache.fetch("foo", force: true) { "foo_bar" }
@@ -141,7 +148,7 @@ module CacheStoreBehavior
end
end
- # Use strings that are guarenteed to compress well, so we can easily tell if
+ # Use strings that are guaranteed to compress well, so we can easily tell if
# the compression kicked in or not.
SMALL_STRING = "0" * 100
LARGE_STRING = "0" * 2.kilobytes