diff options
author | Andrew White <andrew.white@unboxed.co> | 2018-03-31 14:42:20 +0100 |
---|---|---|
committer | Andrew White <andrew.white@unboxed.co> | 2018-03-31 14:42:20 +0100 |
commit | b1a0ab179f23888eaadacd8292cbcec49ab06fdf (patch) | |
tree | 8fe39c01f57e4c204dc8764b25dbe27c986789f8 | |
parent | f4680e492331ccf205ca6cc77d9cdf12d315deb0 (diff) | |
parent | 0548d655f23aa7ace8a434bf2b29e78cc5afdbf6 (diff) | |
download | rails-b1a0ab179f23888eaadacd8292cbcec49ab06fdf.tar.gz rails-b1a0ab179f23888eaadacd8292cbcec49ab06fdf.tar.bz2 rails-b1a0ab179f23888eaadacd8292cbcec49ab06fdf.zip |
Merge pull request #32386 from utilum/tmpname_basename
Fix: FileStoreTest#test_filename_max_size fails in Ruby 2.5.1
-rw-r--r-- | activesupport/test/cache/stores/file_store_test.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/test/cache/stores/file_store_test.rb b/activesupport/test/cache/stores/file_store_test.rb index c3c35a7bcc..f6855bb308 100644 --- a/activesupport/test/cache/stores/file_store_test.rb +++ b/activesupport/test/cache/stores/file_store_test.rb @@ -68,7 +68,9 @@ class FileStoreTest < ActiveSupport::TestCase def test_filename_max_size key = "#{'A' * ActiveSupport::Cache::FileStore::FILENAME_MAX_SIZE}" path = @cache.send(:normalize_key, key, {}) - Dir::Tmpname.create(path) do |tmpname, n, opts| + basename = File.basename(path) + dirname = File.dirname(path) + Dir::Tmpname.create(basename, Dir.tmpdir + dirname) do |tmpname, n, opts| assert File.basename(tmpname + ".lock").length <= 255, "Temp filename too long: #{File.basename(tmpname + '.lock').length}" end end |