diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-04-02 19:43:21 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-08 14:13:29 +0900 |
commit | 2efe741902301a6185d7ee1eff91d53b1d527302 (patch) | |
tree | 5ccc3e207510a6c6d28faca1a6ddedd9a615a910 | |
parent | fca24dd12174a61ce9b01c23db90c63997fae1e8 (diff) |
[rubygems/rubygems] Use a local temporary directory
To make tests more deterministic, since `Dir.tmpdir` sometimes will
return the current directory dependending on the writability of other
paths, and in that case since the current directory is changed by our
tests, tests can fail.
Force a local tmp folder instead, which will always be writable.
https://github.com/rubygems/rubygems/commit/3e522bac65
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3092
-rw-r--r-- | lib/rubygems/test_case.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index 651e89dd0b..6e9c50d9a5 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -300,6 +300,7 @@ class Gem::TestCase < Minitest::Test ENV['GEM_VENDOR'] = nil ENV['GEMRC'] = nil ENV['SOURCE_DATE_EPOCH'] = nil + ENV["TMPDIR"] = File.expand_path("tmp") @current_dir = Dir.pwd @fetcher = nil |