diff --git a/spec/bundler/support/path.rb b/spec/bundler/support/path.rb index 8010b2f293..b26e77d376 100644 --- a/spec/bundler/support/path.rb +++ b/spec/bundler/support/path.rb @@ -102,7 +102,18 @@ module Spec end def tmp(*path) - source_root.join("tmp", scope, *path) + tmp_root(scope).join(*path) + end + + def tmp_root(scope) + source_root.join("tmp", "#{test_env_version}.#{scope}") + end + + # Bump this version whenever you make a breaking change to the spec setup + # that requires regenerating tmp/. + + def test_env_version + 1 end def scope diff --git a/spec/bundler/support/rubygems_ext.rb b/spec/bundler/support/rubygems_ext.rb index fb03d4892e..fb76e34a74 100644 --- a/spec/bundler/support/rubygems_ext.rb +++ b/spec/bundler/support/rubygems_ext.rb @@ -57,8 +57,8 @@ module Spec install_test_deps (2..Parallel.processor_count).each do |n| - source = Path.source_root.join("tmp", "1") - destination = Path.source_root.join("tmp", n.to_s) + source = Path.tmp_root("1") + destination = Path.tmp_root(n.to_s) FileUtils.rm_rf destination FileUtils.cp_r source, destination