aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/caching_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-05-10 08:57:59 -0700
committerJosé Valim <jose.valim@gmail.com>2012-05-10 08:57:59 -0700
commit41420675fd10add560353eaa4e3a3f6518df864e (patch)
tree5448e7da507620364a7911cec955a429ce7e7247 /activesupport/test/caching_test.rb
parentdd9ea8d4dededdad2c6de23260a24b2835fb2fbd (diff)
parentb5005b6259144eeea5b903d659f54bd8a0343d25 (diff)
downloadrails-41420675fd10add560353eaa4e3a3f6518df864e.tar.gz
rails-41420675fd10add560353eaa4e3a3f6518df864e.tar.bz2
rails-41420675fd10add560353eaa4e3a3f6518df864e.zip
Merge pull request #6252 from grosser/unless_exist_for_memory_store
add unless_exist option to memory store
Diffstat (limited to 'activesupport/test/caching_test.rb')
-rw-r--r--activesupport/test/caching_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index bb9ce23276..d62b782e2d 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -684,6 +684,13 @@ class MemoryStoreTest < ActiveSupport::TestCase
assert @cache.exist?(2)
assert !@cache.exist?(1)
end
+
+ def test_write_with_unless_exist
+ assert_equal true, @cache.write(1, "aaaaaaaaaa")
+ assert_equal false, @cache.write(1, "aaaaaaaaaa", :unless_exist => true)
+ @cache.write(1, nil)
+ assert_equal false, @cache.write(1, "aaaaaaaaaa", :unless_exist => true)
+ end
end
uses_memcached 'memcached backed store' do