1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[bundler/bundler] Always set cache_all via config during tests

So that the behavior is the same regardless of the tested bundler
version.

664549427a
This commit is contained in:
David Rodríguez 2019-07-23 17:32:33 +02:00 committed by Hiroshi SHIBATA
parent 267a72be80
commit 2b7e39f364
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
7 changed files with 60 additions and 31 deletions

View file

@ -145,7 +145,8 @@ RSpec.describe "real source plugins" do
let(:uri_hash) { Digest(:SHA1).hexdigest(lib_path("a-path-gem-1.0").to_s) }
it "copies repository to vendor cache and uses it" do
bundle "install"
bundle :cache, forgotten_command_line_options([:all, :cache_all] => true)
bundle "config set cache_all true"
bundle :cache
expect(bundled_app("vendor/cache/a-path-gem-1.0-#{uri_hash}")).to exist
expect(bundled_app("vendor/cache/a-path-gem-1.0-#{uri_hash}/.git")).not_to exist
@ -157,7 +158,8 @@ RSpec.describe "real source plugins" do
it "copies repository to vendor cache and uses it even when installed with bundle --path" do
bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
bundle! :cache, forgotten_command_line_options([:all, :cache_all] => true)
bundle "config set cache_all true"
bundle! :cache
expect(bundled_app("vendor/cache/a-path-gem-1.0-#{uri_hash}")).to exist
@ -167,7 +169,8 @@ RSpec.describe "real source plugins" do
it "bundler package copies repository to vendor cache" do
bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
bundle! :package, forgotten_command_line_options([:all, :cache_all] => true)
bundle "config set cache_all true"
bundle! :package
expect(bundled_app("vendor/cache/a-path-gem-1.0-#{uri_hash}")).to exist
@ -492,7 +495,8 @@ RSpec.describe "real source plugins" do
end
G
bundle :cache, forgotten_command_line_options([:all, :cache_all] => true)
bundle "config set cache_all true"
bundle :cache
expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.git")).not_to exist
expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.bundlecache")).to be_file