Skip to content

Commit 3aa3ee3

Browse files
authored
Merge pull request #8989 from nobu/test-tmpdir
Do not pollute source directory by tests
2 parents d1ff3df + b2002d4 commit 3aa3ee3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

bundler/spec/support/path.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def tmp(*path)
114114
end
115115

116116
def tmp_root
117-
source_root.join("tmp")
117+
ruby_core? && (tmpdir = ENV["TMPDIR"]) ? Pathname(tmpdir) : source_root.join("tmp")
118118
end
119119

120120
# Bump this version whenever you make a breaking change to the spec setup

bundler/spec/support/rubygems_ext.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_setup
4343
# sign extension bundles on macOS, to avoid trying to find the specified key
4444
# from the fake $HOME/Library/Keychains directory.
4545
ENV.delete "RUBY_CODESIGN"
46-
ENV["TMPDIR"] = Path.tmpdir.to_s
46+
ENV["TMPDIR"] = Path.tmpdir.to_s unless Path.ruby_core?
4747

4848
require "rubygems/user_interaction"
4949
Gem::DefaultUserInteraction.ui = Gem::SilentUI.new

0 commit comments

Comments
 (0)