diff options
author | Bundlerbot <bot@bundler.io> | 2020-01-24 21:36:07 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2020-01-24 21:36:07 +0000 |
commit | ce9ce8a0ec73b89440b46ba32633dd01460f650e (patch) | |
tree | d257a8e70c620e6037c46bbd099ea3ffff8c505c | |
parent | 524f524362666cb80700430b9f3740f38befb027 (diff) | |
parent | b4675e9f3009014a89a283fca717515ec524cb76 (diff) | |
download | bundler-ce9ce8a0ec73b89440b46ba32633dd01460f650e.tar.gz |
Merge #7600
7600: Improve cache specs r=deivid-rodriguez a=deivid-rodriguez
<!--
Thanks so much for the contribution!
If you're updating documentation, make sure you run `bin/rake man:build` and
squash the result into your changes, so that all documentation formats are
updated.
To make reviewing this PR a bit easier, please fill out answers to the following questions.
-->
### What was the end-user or developer problem that led to this PR?
I noticed that when running specs on Windows, sometime I got a `_gem` leftover folder in the root of the repo.
### What is your fix for the problem, implemented in this PR?
My fix is to run the particular spec creating this test folder in `tmp`, just like the rest of the specs.
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
-rw-r--r-- | spec/cache/path_spec.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/spec/cache/path_spec.rb b/spec/cache/path_spec.rb index 79e8b4a82b..bd47ac925d 100644 --- a/spec/cache/path_spec.rb +++ b/spec/cache/path_spec.rb @@ -26,13 +26,12 @@ RSpec.describe "bundle cache with path" do expect(bundled_app("vendor/cache/foo-1.0")).to exist expect(bundled_app("vendor/cache/foo-1.0/.bundlecache")).to be_file - FileUtils.rm_rf lib_path("foo-1.0") expect(the_bundle).to include_gems "foo 1.0" end it "copies when the path is outside the bundle and the paths intersect" do - libname = File.basename(Dir.pwd) + "_gem" - libpath = File.join(File.dirname(Dir.pwd), libname) + libname = File.basename(bundled_app) + "_gem" + libpath = File.join(File.dirname(bundled_app), libname) build_lib libname, :path => libpath @@ -45,7 +44,6 @@ RSpec.describe "bundle cache with path" do expect(bundled_app("vendor/cache/#{libname}")).to exist expect(bundled_app("vendor/cache/#{libname}/.bundlecache")).to be_file - FileUtils.rm_rf libpath expect(the_bundle).to include_gems "#{libname} 1.0" end @@ -66,7 +64,6 @@ RSpec.describe "bundle cache with path" do bundle :cache expect(bundled_app("vendor/cache/foo-1.0")).to exist - FileUtils.rm_rf lib_path("foo-1.0") run "require 'foo'" expect(out).to eq("CACHE") |