1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use random tmp dir for FileStoreTest

This commit is contained in:
John Hawthorn 2019-06-09 07:24:29 -07:00
parent ce4c26cf88
commit 2afc230053

View file

@ -6,7 +6,10 @@ require_relative "../behaviors"
require "pathname"
class FileStoreTest < ActiveSupport::TestCase
attr_reader :cache_dir
def setup
@cache_dir = Dir.mktmpdir("file-store-")
Dir.mkdir(cache_dir) unless File.exist?(cache_dir)
@cache = ActiveSupport::Cache.lookup_store(:file_store, cache_dir, expires_in: 60)
@peek = ActiveSupport::Cache.lookup_store(:file_store, cache_dir, expires_in: 60)
@ -21,10 +24,6 @@ class FileStoreTest < ActiveSupport::TestCase
rescue Errno::ENOENT
end
def cache_dir
File.join(Dir.pwd, "tmp_cache")
end
include CacheStoreBehavior
include CacheStoreVersionBehavior
include LocalCacheBehavior