summaryrefslogtreecommitdiff
path: root/test/rubygems
diff options
context:
space:
mode:
authorxndcn <xndchn@gmail.com>2020-08-04 13:25:59 +0800
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-09-28 14:54:22 +0900
commitac3f80a58e1d27b92e4f6d2f5a3cff8ba530e1e3 (patch)
tree48c55f9d2c1facf10f299bbd40025947f23f73ed /test/rubygems
parentc55b5f106295aa3c7611a15a9bf7f0d589447ea7 (diff)
[rubygems/rubygems] Add writable check for cache dir
Sometimes "install_dir/cache" directory is not writable although "install_dir" is writable. https://github.com/rubygems/rubygems/commit/665221cb69
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3599
Diffstat (limited to 'test/rubygems')
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb
index 9f98f8042c..f6ca00589f 100644
--- a/test/rubygems/test_gem_remote_fetcher.rb
+++ b/test/rubygems/test_gem_remote_fetcher.rb
@@ -321,6 +321,8 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
local_path = File.join @tempdir, @a1.file_name
inst = nil
FileUtils.chmod 0555, @a1.cache_dir
+ FileUtils.mkdir_p File.join(Gem.user_dir, "cache") rescue nil
+ FileUtils.chmod 0555, File.join(Gem.user_dir, "cache")
Dir.chdir @tempdir do
inst = Gem::RemoteFetcher.fetcher
@@ -329,6 +331,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
assert_equal(File.join(@tempdir, @a1.file_name),
inst.download(@a1, local_path))
ensure
+ FileUtils.chmod 0755, File.join(Gem.user_dir, "cache")
FileUtils.chmod 0755, @a1.cache_dir
end