aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-10-28 19:09:22 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-10-28 19:09:22 -0200
commitf18cf8e4884529f28d19f118abd0b46c99bd8cfa (patch)
treeda0bdb7f4888b51cac17e3d31029c71ff52b5797 /activesupport/test
parentf78c5fbb96b507fb80405c25cfce12136f9d45cd (diff)
parentc17bd7476abb0bade3c27e652b1d56548d0ee4ae (diff)
downloadrails-f18cf8e4884529f28d19f118abd0b46c99bd8cfa.tar.gz
rails-f18cf8e4884529f28d19f118abd0b46c99bd8cfa.tar.bz2
rails-f18cf8e4884529f28d19f118abd0b46c99bd8cfa.zip
Merge pull request #11785 from grosser/grosser/file-unless-exist
support :unless_exist for FileCache Conflicts: activesupport/CHANGELOG.md activesupport/test/caching_test.rb
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 16d087ab9d..51007402a1 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -721,6 +721,13 @@ class FileStoreTest < ActiveSupport::TestCase
assert @cache.exist?('baz')
assert @cache.exist?('quux')
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
class MemoryStoreTest < ActiveSupport::TestCase