aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorgrosser <grosser.michael@gmail.com>2012-05-10 08:19:45 -0700
committergrosser <grosser.michael@gmail.com>2012-05-10 08:19:45 -0700
commitb5005b6259144eeea5b903d659f54bd8a0343d25 (patch)
tree5448e7da507620364a7911cec955a429ce7e7247 /activesupport/test
parentdd9ea8d4dededdad2c6de23260a24b2835fb2fbd (diff)
downloadrails-b5005b6259144eeea5b903d659f54bd8a0343d25.tar.gz
rails-b5005b6259144eeea5b903d659f54bd8a0343d25.tar.bz2
rails-b5005b6259144eeea5b903d659f54bd8a0343d25.zip
add unless_exist option to memory store
Diffstat (limited to 'activesupport/test')
-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