diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-01-10 09:56:42 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-01-12 20:46:33 +0100 |
commit | 7dc38a75680f991bf32320cca850c32d1dcd90ca (patch) | |
tree | e532f1f4eb42a0b9f438ef40380a1ab9ae810975 /spec/commands/binstubs_spec.rb | |
parent | 55630c23f4e0683e820116af917888cf23569020 (diff) | |
download | bundler-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/commands/binstubs_spec.rb')
-rw-r--r-- | spec/commands/binstubs_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb index 1d84b16524..f77e1772bb 100644 --- a/spec/commands/binstubs_spec.rb +++ b/spec/commands/binstubs_spec.rb @@ -86,7 +86,7 @@ RSpec.describe "bundle binstubs <gem>" do bundle "binstubs rack" - File.open("bin/bundle", "wb") do |file| + File.open(bundled_app("bin/bundle"), "wb") do |file| file.print "OMG" end @@ -301,7 +301,7 @@ RSpec.describe "bundle binstubs <gem>" do bundle "binstubs rack --shebang jruby" - expect(File.open("bin/rackup").gets).to eq("#!/usr/bin/env jruby\n") + expect(File.open(bundled_app("bin/rackup")).gets).to eq("#!/usr/bin/env jruby\n") end end end |