summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2020-01-04 18:10:37 +0000
committerBundlerbot <bot@bundler.io>2020-01-04 18:10:37 +0000
commitaa074c9f5de0e43c2187d387e6a25d55b01ec75a (patch)
tree091acabb159fc494e094dd16ccca0ed07d85d5f5
parentd7344f28ccc4739d9d30fb81f582896e89c2649c (diff)
parent88f4ecd5b4f9ded53a81109752ace0c68571de02 (diff)
downloadbundler-aa074c9f5de0e43c2187d387e6a25d55b01ec75a.tar.gz
Merge #7543
7543: Fix flaky test failures r=deivid-rodriguez a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was `SharedHelpers#in_bundle?` specs could fail depending on the run order. ### What was your diagnosis of the problem? My diagnosis was that the test Gemfile needs to be removed after the test because other specs rely on it being missing. ### What is your fix for the problem, implemented in this PR? My fix is to remove the `Gemfile` after the test. Closes #6891. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
-rw-r--r--spec/bundler/shared_helpers_spec.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/bundler/shared_helpers_spec.rb b/spec/bundler/shared_helpers_spec.rb
index 4530a9a5cd..5c91cb7bd1 100644
--- a/spec/bundler/shared_helpers_spec.rb
+++ b/spec/bundler/shared_helpers_spec.rb
@@ -109,7 +109,8 @@ RSpec.describe Bundler::SharedHelpers do
shared_examples_for "correctly determines whether to return a Gemfile path" do
context "currently in directory with a Gemfile" do
- before { File.new("Gemfile", "w") }
+ before { FileUtils.touch("Gemfile") }
+ after { FileUtils.rm("Gemfile") }
it "returns path of the bundle Gemfile" do
expect(subject.in_bundle?).to eq("#{bundled_app}/Gemfile")