diff --git a/bundler/spec/support/path.rb b/bundler/spec/support/path.rb index cc750f55d81f..9f634a5e86e4 100644 --- a/bundler/spec/support/path.rb +++ b/bundler/spec/support/path.rb @@ -114,7 +114,7 @@ def tmp(*path) end def tmp_root - source_root.join("tmp") + ruby_core? && (tmpdir = ENV["TMPDIR"]) ? Pathname(tmpdir) : source_root.join("tmp") end # Bump this version whenever you make a breaking change to the spec setup diff --git a/bundler/spec/support/rubygems_ext.rb b/bundler/spec/support/rubygems_ext.rb index 2d681529aac2..997a70747d20 100644 --- a/bundler/spec/support/rubygems_ext.rb +++ b/bundler/spec/support/rubygems_ext.rb @@ -43,7 +43,7 @@ def test_setup # sign extension bundles on macOS, to avoid trying to find the specified key # from the fake $HOME/Library/Keychains directory. ENV.delete "RUBY_CODESIGN" - ENV["TMPDIR"] = Path.tmpdir.to_s + ENV["TMPDIR"] = Path.tmpdir.to_s unless ruby_core? require "rubygems/user_interaction" Gem::DefaultUserInteraction.ui = Gem::SilentUI.new