summaryrefslogtreecommitdiff
path: root/spec/cache
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-01-10 09:56:42 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2020-01-12 20:46:33 +0100
commit7dc38a75680f991bf32320cca850c32d1dcd90ca (patch)
treee532f1f4eb42a0b9f438ef40380a1ab9ae810975 /spec/cache
parent55630c23f4e0683e820116af917888cf23569020 (diff)
downloadbundler-7dc38a75680f991bf32320cca850c32d1dcd90ca.tar.gz
Remove global directory switching from specstests/less_flakyness
`Dir.chdir` is not thread safe, so it makes our parallel specs flaky. Instead, use the following alternatives: * Use `:chdir` parameter to `Open3` methods for specs that shell out. * Stub `find_gemfile` or other relevant helpers for unit tests.
Diffstat (limited to 'spec/cache')
-rw-r--r--spec/cache/git_spec.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/spec/cache/git_spec.rb b/spec/cache/git_spec.rb
index 75525d405b..ecdc97f837 100644
--- a/spec/cache/git_spec.rb
+++ b/spec/cache/git_spec.rb
@@ -155,10 +155,8 @@ RSpec.describe "bundle cache with git" do
s.add_dependency "submodule"
end
- Dir.chdir(lib_path("has_submodule-1.0")) do
- sys_exec "git submodule add #{lib_path("submodule-1.0")} submodule-1.0"
- `git commit -m "submodulator"`
- end
+ sys_exec "git submodule add #{lib_path("submodule-1.0")} submodule-1.0", :dir => lib_path("has_submodule-1.0")
+ sys_exec "git commit -m \"submodulator\"", :dir => lib_path("has_submodule-1.0")
install_gemfile <<-G
git "#{lib_path("has_submodule-1.0")}", :submodules => true do