summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-10-30 03:13:00 +0000
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-11-07 16:41:41 +0100
commit49dbb01823b8863b6b853fd48a7f030e34207d57 (patch)
treeedd90efe4a26dfb17b481dc0c7765d479c1409bb /spec
parentfd4b3cfca2cdbe7e059ca157dfd4233d9175dd20 (diff)
downloadbundler-49dbb01823b8863b6b853fd48a7f030e34207d57.tar.gz
Merge #7389
7389: Wrap up `bundle cache` migration to current `bundle package` r=indirect a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was that after https://github.com/bundler/bundler/pull/7249, we added the current `bundle package` functionality to the current `bundle cache` command, so that these commands are now aliases of each other. The initial plan was to do this in a more careful manner but we concluded that this was only _adding_ functionality to `bundle cache`, so not backwards incompatible. We still need to wrap up the original plan, where `bundle cache` is the preferred command. ### What is your fix for the problem, implemented in this PR? My fix is to migrate docs, tests and help text to use `bundle cache`, and to remove duplicated specs for `bundle cache` and `bundle package`, since they are testing the exact same code. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> (cherry picked from commit 5ba1360de631e2fabf2bfa998b104c4355c58b13)
Diffstat (limited to 'spec')
-rw-r--r--spec/cache/cache_path_spec.rb6
-rw-r--r--spec/cache/git_spec.rb342
-rw-r--r--spec/cache/path_spec.rb214
-rw-r--r--spec/commands/cache_spec.rb (renamed from spec/commands/package_spec.rb)34
-rw-r--r--spec/install/deploy_spec.rb2
-rw-r--r--spec/install/gemfile/git_spec.rb2
-rw-r--r--spec/install/gemfile/sources_spec.rb2
-rw-r--r--spec/lock/lockfile_spec.rb2
-rw-r--r--spec/other/platform_spec.rb12
-rw-r--r--spec/plugins/source/example_spec.rb2
10 files changed, 307 insertions, 311 deletions
diff --git a/spec/cache/cache_path_spec.rb b/spec/cache/cache_path_spec.rb
index 1a61494130..12385427b1 100644
--- a/spec/cache/cache_path_spec.rb
+++ b/spec/cache/cache_path_spec.rb
@@ -10,7 +10,7 @@ RSpec.describe "bundle package" do
context "with --cache-path" do
it "caches gems at given path" do
- bundle :package, "cache-path" => "vendor/cache-foo"
+ bundle :cache, "cache-path" => "vendor/cache-foo"
expect(bundled_app("vendor/cache-foo/rack-1.0.0.gem")).to exist
end
end
@@ -18,14 +18,14 @@ RSpec.describe "bundle package" do
context "with config cache_path" do
it "caches gems at given path" do
bundle "config set cache_path vendor/cache-foo"
- bundle :package
+ bundle :cache
expect(bundled_app("vendor/cache-foo/rack-1.0.0.gem")).to exist
end
end
context "with absolute --cache-path" do
it "caches gems at given path" do
- bundle :package, "cache-path" => "/tmp/cache-foo"
+ bundle :cache, "cache-path" => "/tmp/cache-foo"
expect(bundled_app("/tmp/cache-foo/rack-1.0.0.gem")).to exist
end
end
diff --git a/spec/cache/git_spec.rb b/spec/cache/git_spec.rb
index 1cb278e912..75525d405b 100644
--- a/spec/cache/git_spec.rb
+++ b/spec/cache/git_spec.rb
@@ -12,230 +12,228 @@ RSpec.describe "git base name" do
end
end
-%w[cache package].each do |cmd|
- RSpec.describe "bundle #{cmd} with git" do
- it "copies repository to vendor cache and uses it" do
- git = build_git "foo"
- ref = git.ref_for("master", 11)
-
- install_gemfile <<-G
- gem "foo", :git => '#{lib_path("foo-1.0")}'
- G
-
- bundle "config set cache_all true"
- bundle cmd
- 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
-
- FileUtils.rm_rf lib_path("foo-1.0")
- expect(the_bundle).to include_gems "foo 1.0"
- end
-
- it "copies repository to vendor cache and uses it even when installed with bundle --path" do
- git = build_git "foo"
- ref = git.ref_for("master", 11)
+RSpec.describe "bundle cache with git" do
+ it "copies repository to vendor cache and uses it" do
+ git = build_git "foo"
+ ref = git.ref_for("master", 11)
+
+ install_gemfile <<-G
+ gem "foo", :git => '#{lib_path("foo-1.0")}'
+ G
+
+ 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
+
+ FileUtils.rm_rf lib_path("foo-1.0")
+ expect(the_bundle).to include_gems "foo 1.0"
+ end
- install_gemfile <<-G
- gem "foo", :git => '#{lib_path("foo-1.0")}'
- G
+ it "copies repository to vendor cache and uses it even when installed with bundle --path" do
+ git = build_git "foo"
+ ref = git.ref_for("master", 11)
- bundle "install --path vendor/bundle"
- bundle "config set cache_all true"
- bundle cmd
+ install_gemfile <<-G
+ gem "foo", :git => '#{lib_path("foo-1.0")}'
+ G
- expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
- expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.git")).not_to exist
+ bundle "install --path vendor/bundle"
+ bundle "config set cache_all true"
+ bundle :cache
- FileUtils.rm_rf lib_path("foo-1.0")
- expect(the_bundle).to include_gems "foo 1.0"
- end
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.git")).not_to exist
- it "runs twice without exploding" do
- build_git "foo"
+ FileUtils.rm_rf lib_path("foo-1.0")
+ expect(the_bundle).to include_gems "foo 1.0"
+ end
- install_gemfile! <<-G
- gem "foo", :git => '#{lib_path("foo-1.0")}'
- G
+ it "runs twice without exploding" do
+ build_git "foo"
- bundle "config set cache_all true"
- bundle! cmd
- bundle! cmd
+ install_gemfile! <<-G
+ gem "foo", :git => '#{lib_path("foo-1.0")}'
+ G
- expect(out).to include "Updating files in vendor/cache"
- FileUtils.rm_rf lib_path("foo-1.0")
- expect(the_bundle).to include_gems "foo 1.0"
- end
+ bundle "config set cache_all true"
+ bundle! :cache
+ bundle! :cache
- it "tracks updates" do
- git = build_git "foo"
- old_ref = git.ref_for("master", 11)
+ expect(out).to include "Updating files in vendor/cache"
+ FileUtils.rm_rf lib_path("foo-1.0")
+ expect(the_bundle).to include_gems "foo 1.0"
+ end
- install_gemfile <<-G
- gem "foo", :git => '#{lib_path("foo-1.0")}'
- G
+ it "tracks updates" do
+ git = build_git "foo"
+ old_ref = git.ref_for("master", 11)
- bundle "config set cache_all true"
- bundle cmd
+ install_gemfile <<-G
+ gem "foo", :git => '#{lib_path("foo-1.0")}'
+ G
- update_git "foo" do |s|
- s.write "lib/foo.rb", "puts :CACHE"
- end
+ bundle "config set cache_all true"
+ bundle :cache
- ref = git.ref_for("master", 11)
- expect(ref).not_to eq(old_ref)
+ update_git "foo" do |s|
+ s.write "lib/foo.rb", "puts :CACHE"
+ end
- bundle! "update", :all => true
- bundle "config set cache_all true"
- bundle! cmd
+ ref = git.ref_for("master", 11)
+ expect(ref).not_to eq(old_ref)
- expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
- expect(bundled_app("vendor/cache/foo-1.0-#{old_ref}")).not_to exist
+ bundle! "update", :all => true
+ bundle "config set cache_all true"
+ bundle! :cache
- FileUtils.rm_rf lib_path("foo-1.0")
- run! "require 'foo'"
- expect(out).to eq("CACHE")
- end
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
+ expect(bundled_app("vendor/cache/foo-1.0-#{old_ref}")).not_to exist
- it "tracks updates when specifying the gem" do
- git = build_git "foo"
- old_ref = git.ref_for("master", 11)
+ FileUtils.rm_rf lib_path("foo-1.0")
+ run! "require 'foo'"
+ expect(out).to eq("CACHE")
+ end
- install_gemfile <<-G
- gem "foo", :git => '#{lib_path("foo-1.0")}'
- G
+ it "tracks updates when specifying the gem" do
+ git = build_git "foo"
+ old_ref = git.ref_for("master", 11)
- bundle "config set cache_all true"
- bundle! cmd
+ install_gemfile <<-G
+ gem "foo", :git => '#{lib_path("foo-1.0")}'
+ G
- update_git "foo" do |s|
- s.write "lib/foo.rb", "puts :CACHE"
- end
+ bundle "config set cache_all true"
+ bundle! :cache
- ref = git.ref_for("master", 11)
- expect(ref).not_to eq(old_ref)
+ update_git "foo" do |s|
+ s.write "lib/foo.rb", "puts :CACHE"
+ end
- bundle "update foo"
+ ref = git.ref_for("master", 11)
+ expect(ref).not_to eq(old_ref)
- expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
- expect(bundled_app("vendor/cache/foo-1.0-#{old_ref}")).not_to exist
+ bundle "update foo"
- FileUtils.rm_rf lib_path("foo-1.0")
- run "require 'foo'"
- expect(out).to eq("CACHE")
- end
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
+ expect(bundled_app("vendor/cache/foo-1.0-#{old_ref}")).not_to exist
- it "uses the local repository to generate the cache" do
- git = build_git "foo"
- ref = git.ref_for("master", 11)
+ FileUtils.rm_rf lib_path("foo-1.0")
+ run "require 'foo'"
+ expect(out).to eq("CACHE")
+ end
- gemfile <<-G
- gem "foo", :git => '#{lib_path("foo-invalid")}', :branch => :master
- G
+ it "uses the local repository to generate the cache" do
+ git = build_git "foo"
+ ref = git.ref_for("master", 11)
- bundle %(config set local.foo #{lib_path("foo-1.0")})
- bundle "install"
- bundle "config set cache_all true"
- bundle cmd
+ gemfile <<-G
+ gem "foo", :git => '#{lib_path("foo-invalid")}', :branch => :master
+ G
- expect(bundled_app("vendor/cache/foo-invalid-#{ref}")).to exist
+ bundle %(config set local.foo #{lib_path("foo-1.0")})
+ bundle "install"
+ bundle "config set cache_all true"
+ bundle :cache
- # Updating the local still uses the local.
- update_git "foo" do |s|
- s.write "lib/foo.rb", "puts :LOCAL"
- end
+ expect(bundled_app("vendor/cache/foo-invalid-#{ref}")).to exist
- run "require 'foo'"
- expect(out).to eq("LOCAL")
+ # Updating the local still uses the local.
+ update_git "foo" do |s|
+ s.write "lib/foo.rb", "puts :LOCAL"
end
- it "copies repository to vendor cache, including submodules" do
- build_git "submodule", "1.0"
+ run "require 'foo'"
+ expect(out).to eq("LOCAL")
+ end
- git = build_git "has_submodule", "1.0" do |s|
- s.add_dependency "submodule"
- end
+ it "copies repository to vendor cache, including submodules" do
+ build_git "submodule", "1.0"
- 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
+ git = build_git "has_submodule", "1.0" do |s|
+ s.add_dependency "submodule"
+ end
- install_gemfile <<-G
- git "#{lib_path("has_submodule-1.0")}", :submodules => true do
- gem "has_submodule"
- end
- G
+ 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
+
+ install_gemfile <<-G
+ git "#{lib_path("has_submodule-1.0")}", :submodules => true do
+ gem "has_submodule"
+ end
+ G
- ref = git.ref_for("master", 11)
- bundle "config set cache_all true"
- bundle cmd
+ ref = git.ref_for("master", 11)
+ bundle "config set cache_all true"
+ bundle :cache
- expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}")).to exist
- expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}/submodule-1.0")).to exist
- expect(the_bundle).to include_gems "has_submodule 1.0"
- end
+ expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}")).to exist
+ expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}/submodule-1.0")).to exist
+ expect(the_bundle).to include_gems "has_submodule 1.0"
+ end
- it "displays warning message when detecting git repo in Gemfile", :bundler => "< 3" do
- build_git "foo"
+ it "displays warning message when detecting git repo in Gemfile", :bundler => "< 3" do
+ build_git "foo"
- install_gemfile <<-G
- gem "foo", :git => '#{lib_path("foo-1.0")}'
- G
+ install_gemfile <<-G
+ gem "foo", :git => '#{lib_path("foo-1.0")}'
+ G
- bundle cmd
+ bundle :cache
- expect(err).to include("Your Gemfile contains path and git dependencies.")
- end
+ expect(err).to include("Your Gemfile contains path and git dependencies.")
+ end
- it "does not display warning message if cache_all is set in bundle config" do
- build_git "foo"
+ it "does not display warning message if cache_all is set in bundle config" do
+ build_git "foo"
- install_gemfile <<-G
- gem "foo", :git => '#{lib_path("foo-1.0")}'
- G
+ install_gemfile <<-G
+ gem "foo", :git => '#{lib_path("foo-1.0")}'
+ G
- bundle "config set cache_all true"
- bundle cmd
- bundle cmd
+ bundle "config set cache_all true"
+ bundle :cache
+ bundle :cache
- expect(err).not_to include("Your Gemfile contains path and git dependencies.")
- end
+ expect(err).not_to include("Your Gemfile contains path and git dependencies.")
+ end
- it "caches pre-evaluated gemspecs" do
- git = build_git "foo"
+ it "caches pre-evaluated gemspecs" do
+ git = build_git "foo"
- # Insert a gemspec method that shells out
- spec_lines = lib_path("foo-1.0/foo.gemspec").read.split("\n")
- spec_lines.insert(-2, "s.description = `echo bob`")
- update_git("foo") {|s| s.write "foo.gemspec", spec_lines.join("\n") }
+ # Insert a gemspec method that shells out
+ spec_lines = lib_path("foo-1.0/foo.gemspec").read.split("\n")
+ spec_lines.insert(-2, "s.description = `echo bob`")
+ update_git("foo") {|s| s.write "foo.gemspec", spec_lines.join("\n") }
- install_gemfile <<-G
- gem "foo", :git => '#{lib_path("foo-1.0")}'
- G
- bundle "config set cache_all true"
- bundle cmd
+ install_gemfile <<-G
+ gem "foo", :git => '#{lib_path("foo-1.0")}'
+ G
+ bundle "config set cache_all true"
+ bundle :cache
- ref = git.ref_for("master", 11)
- gemspec = bundled_app("vendor/cache/foo-1.0-#{ref}/foo.gemspec").read
- expect(gemspec).to_not match("`echo bob`")
- end
+ ref = git.ref_for("master", 11)
+ gemspec = bundled_app("vendor/cache/foo-1.0-#{ref}/foo.gemspec").read
+ expect(gemspec).to_not match("`echo bob`")
+ end
- it "can install after #{cmd} with git not installed" do
- build_git "foo"
+ it "can install after bundle cache with git not installed" do
+ build_git "foo"
- gemfile <<-G
- gem "foo", :git => '#{lib_path("foo-1.0")}'
- G
- bundle! "config set cache_all true"
- bundle! cmd, "all-platforms" => true, :install => false, :path => "./vendor/cache"
+ gemfile <<-G
+ gem "foo", :git => '#{lib_path("foo-1.0")}'
+ G
+ bundle! "config set cache_all true"
+ bundle! :cache, "all-platforms" => true, :install => false, :path => "./vendor/cache"
- simulate_new_machine
- with_path_as "" do
- bundle! "config set deployment true"
- bundle! :install, :local => true
- expect(the_bundle).to include_gem "foo 1.0"
- end
+ simulate_new_machine
+ with_path_as "" do
+ bundle! "config set deployment true"
+ bundle! :install, :local => true
+ expect(the_bundle).to include_gem "foo 1.0"
end
end
end
diff --git a/spec/cache/path_spec.rb b/spec/cache/path_spec.rb
index 3bbd7b1805..79e8b4a82b 100644
--- a/spec/cache/path_spec.rb
+++ b/spec/cache/path_spec.rb
@@ -1,146 +1,144 @@
# frozen_string_literal: true
-%w[cache package].each do |cmd|
- RSpec.describe "bundle #{cmd} with path" do
- it "is no-op when the path is within the bundle" do
- build_lib "foo", :path => bundled_app("lib/foo")
-
- install_gemfile <<-G
- gem "foo", :path => '#{bundled_app("lib/foo")}'
- G
-
- bundle "config set cache_all true"
- bundle cmd
- expect(bundled_app("vendor/cache/foo-1.0")).not_to exist
- expect(the_bundle).to include_gems "foo 1.0"
- end
+RSpec.describe "bundle cache with path" do
+ it "is no-op when the path is within the bundle" do
+ build_lib "foo", :path => bundled_app("lib/foo")
+
+ install_gemfile <<-G
+ gem "foo", :path => '#{bundled_app("lib/foo")}'
+ G
+
+ bundle "config set cache_all true"
+ bundle :cache
+ expect(bundled_app("vendor/cache/foo-1.0")).not_to exist
+ expect(the_bundle).to include_gems "foo 1.0"
+ end
- it "copies when the path is outside the bundle " do
- build_lib "foo"
+ it "copies when the path is outside the bundle " do
+ build_lib "foo"
- install_gemfile <<-G
- gem "foo", :path => '#{lib_path("foo-1.0")}'
- G
+ install_gemfile <<-G
+ gem "foo", :path => '#{lib_path("foo-1.0")}'
+ G
- bundle "config set cache_all true"
- bundle cmd
- expect(bundled_app("vendor/cache/foo-1.0")).to exist
- expect(bundled_app("vendor/cache/foo-1.0/.bundlecache")).to be_file
+ bundle "config set cache_all true"
+ bundle :cache
+ 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
+ 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)
+ 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)
- build_lib libname, :path => libpath
+ build_lib libname, :path => libpath
- install_gemfile <<-G
- gem "#{libname}", :path => '#{libpath}'
- G
+ install_gemfile <<-G
+ gem "#{libname}", :path => '#{libpath}'
+ G
- bundle "config set cache_all true"
- bundle cmd
- expect(bundled_app("vendor/cache/#{libname}")).to exist
- expect(bundled_app("vendor/cache/#{libname}/.bundlecache")).to be_file
+ bundle "config set cache_all true"
+ bundle :cache
+ 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
+ FileUtils.rm_rf libpath
+ expect(the_bundle).to include_gems "#{libname} 1.0"
+ end
- it "updates the path on each cache" do
- build_lib "foo"
+ it "updates the path on each cache" do
+ build_lib "foo"
- install_gemfile <<-G
- gem "foo", :path => '#{lib_path("foo-1.0")}'
- G
+ install_gemfile <<-G
+ gem "foo", :path => '#{lib_path("foo-1.0")}'
+ G
- bundle "config set cache_all true"
- bundle cmd
+ bundle "config set cache_all true"
+ bundle :cache
- build_lib "foo" do |s|
- s.write "lib/foo.rb", "puts :CACHE"
- end
+ build_lib "foo" do |s|
+ s.write "lib/foo.rb", "puts :CACHE"
+ end
- bundle cmd
+ bundle :cache
- expect(bundled_app("vendor/cache/foo-1.0")).to exist
- FileUtils.rm_rf lib_path("foo-1.0")
+ 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")
- end
+ run "require 'foo'"
+ expect(out).to eq("CACHE")
+ end
- it "removes stale entries cache" do
- build_lib "foo"
+ it "removes stale entries cache" do
+ build_lib "foo"
- install_gemfile <<-G
- gem "foo", :path => '#{lib_path("foo-1.0")}'
- G
+ install_gemfile <<-G
+ gem "foo", :path => '#{lib_path("foo-1.0")}'
+ G
- bundle "config set cache_all true"
- bundle cmd
+ bundle "config set cache_all true"
+ bundle :cache
- install_gemfile <<-G
- gem "bar", :path => '#{lib_path("bar-1.0")}'
- G
+ install_gemfile <<-G
+ gem "bar", :path => '#{lib_path("bar-1.0")}'
+ G
- bundle cmd
- expect(bundled_app("vendor/cache/bar-1.0")).not_to exist
- end
+ bundle :cache
+ expect(bundled_app("vendor/cache/bar-1.0")).not_to exist
+ end
- it "raises a warning without --all", :bundler => "< 3" do
- build_lib "foo"
+ it "raises a warning without --all", :bundler => "< 3" do
+ build_lib "foo"
- install_gemfile <<-G
- gem "foo", :path => '#{lib_path("foo-1.0")}'
- G
+ install_gemfile <<-G
+ gem "foo", :path => '#{lib_path("foo-1.0")}'
+ G
- bundle cmd
- expect(err).to match(/please pass the \-\-all flag/)
- expect(bundled_app("vendor/cache/foo-1.0")).not_to exist
- end
+ bundle :cache
+ expect(err).to match(/please pass the \-\-all flag/)
+ expect(bundled_app("vendor/cache/foo-1.0")).not_to exist
+ end
- it "stores the given flag" do
- build_lib "foo"
+ it "stores the given flag" do
+ build_lib "foo"
- install_gemfile <<-G
- gem "foo", :path => '#{lib_path("foo-1.0")}'
- G
+ install_gemfile <<-G
+ gem "foo", :path => '#{lib_path("foo-1.0")}'
+ G
- bundle "config set cache_all true"
- bundle cmd
- build_lib "bar"
+ bundle "config set cache_all true"
+ bundle :cache
+ build_lib "bar"
- install_gemfile <<-G
- gem "foo", :path => '#{lib_path("foo-1.0")}'
- gem "bar", :path => '#{lib_path("bar-1.0")}'
- G
+ install_gemfile <<-G
+ gem "foo", :path => '#{lib_path("foo-1.0")}'
+ gem "bar", :path => '#{lib_path("bar-1.0")}'
+ G
- bundle cmd
- expect(bundled_app("vendor/cache/bar-1.0")).to exist
- end
+ bundle :cache
+ expect(bundled_app("vendor/cache/bar-1.0")).to exist
+ end
- it "can rewind chosen configuration" do
- build_lib "foo"
+ it "can rewind chosen configuration" do
+ build_lib "foo"
- install_gemfile <<-G
- gem "foo", :path => '#{lib_path("foo-1.0")}'
- G
+ install_gemfile <<-G
+ gem "foo", :path => '#{lib_path("foo-1.0")}'
+ G
- bundle "config set cache_all true"
- bundle cmd
- build_lib "baz"
+ bundle "config set cache_all true"
+ bundle :cache
+ build_lib "baz"
- gemfile <<-G
- gem "foo", :path => '#{lib_path("foo-1.0")}'
- gem "baz", :path => '#{lib_path("baz-1.0")}'
- G
+ gemfile <<-G
+ gem "foo", :path => '#{lib_path("foo-1.0")}'
+ gem "baz", :path => '#{lib_path("baz-1.0")}'
+ G
- bundle "#{cmd} --no-all"
- expect(bundled_app("vendor/cache/baz-1.0")).not_to exist
- end
+ bundle "cache --no-all"
+ expect(bundled_app("vendor/cache/baz-1.0")).not_to exist
end
end
diff --git a/spec/commands/package_spec.rb b/spec/commands/cache_spec.rb
index da22c002eb..07ec186c2f 100644
--- a/spec/commands/package_spec.rb
+++ b/spec/commands/cache_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-RSpec.describe "bundle package" do
+RSpec.describe "bundle cache" do
context "with --gemfile" do
it "finds the gemfile" do
gemfile bundled_app("NotGemfile"), <<-G
@@ -8,7 +8,7 @@ RSpec.describe "bundle package" do
gem 'rack'
G
- bundle "package --gemfile=NotGemfile"
+ bundle "cache --gemfile=NotGemfile"
ENV["BUNDLE_GEMFILE"] = "NotGemfile"
expect(the_bundle).to include_gems "rack 1.0.0"
@@ -25,7 +25,7 @@ RSpec.describe "bundle package" do
D
bundle "config set cache_all true"
- bundle :package
+ bundle :cache
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/bundler-0.9.gem")).to_not exist
@@ -56,7 +56,7 @@ RSpec.describe "bundle package" do
D
bundle "config set cache_all true"
- bundle! :package
+ bundle! :cache
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/nokogiri-1.4.2.gem")).to exist
@@ -88,7 +88,7 @@ RSpec.describe "bundle package" do
D
bundle "config set cache_all true"
- bundle! :package
+ bundle! :cache
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/nokogiri-1.4.2.gem")).to exist
@@ -133,7 +133,7 @@ RSpec.describe "bundle package" do
D
bundle "config set cache_all true"
- bundle! :package
+ bundle! :cache
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/nokogiri-1.4.2.gem")).to exist
@@ -152,7 +152,7 @@ RSpec.describe "bundle package" do
gem 'rack'
D
- bundle! :package, forgotten_command_line_options(:path => bundled_app("test"))
+ bundle! :cache, forgotten_command_line_options(:path => bundled_app("test"))
expect(the_bundle).to include_gems "rack 1.0.0"
expect(bundled_app("test/vendor/cache/")).to exist
@@ -166,7 +166,7 @@ RSpec.describe "bundle package" do
gem 'rack'
D
- bundle! "package --no-install"
+ bundle! "cache --no-install"
expect(the_bundle).not_to include_gems "rack 1.0.0"
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
@@ -178,7 +178,7 @@ RSpec.describe "bundle package" do
gem 'rack'
D
- bundle! "package --no-install"
+ bundle! "cache --no-install"
bundle! "install"
expect(the_bundle).to include_gems "rack 1.0.0"
@@ -190,7 +190,7 @@ RSpec.describe "bundle package" do
gem "rack", "1.0.0"
D
- bundle! "package --no-install"
+ bundle! "cache --no-install"
bundle! "update --all"
expect(the_bundle).to include_gems "rack 1.0.0"
@@ -204,7 +204,7 @@ RSpec.describe "bundle package" do
gem 'rack', :platforms => :ruby_19
D
- bundle "package --all-platforms"
+ bundle "cache --all-platforms"
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
end
@@ -226,7 +226,7 @@ RSpec.describe "bundle package" do
end
G
- bundle! :package, "all-platforms" => true
+ bundle! :cache, "all-platforms" => true
expect(bundled_app("vendor/cache/weakling-0.0.3.gem")).to exist
expect(bundled_app("vendor/cache/uninstallable-2.0.gem")).to exist
expect(the_bundle).to include_gem "rack 1.0"
@@ -247,7 +247,7 @@ RSpec.describe "bundle package" do
bundle "install"
end
- subject { bundle :package, forgotten_command_line_options(:frozen => true) }
+ subject { bundle :cache, forgotten_command_line_options(:frozen => true) }
it "tries to install with frozen" do
bundle! "config set deployment true"
@@ -276,7 +276,7 @@ RSpec.describe "bundle install with gem sources" do
gem "rack"
G
- bundle :pack
+ bundle :cache
simulate_new_machine
FileUtils.rm_rf gem_repo2
@@ -291,7 +291,7 @@ RSpec.describe "bundle install with gem sources" do
gem "rack"
G
- bundle! :pack
+ bundle! :cache
simulate_new_machine
FileUtils.rm_rf gem_repo2
@@ -304,7 +304,7 @@ RSpec.describe "bundle install with gem sources" do
source "#{file_uri_for(gem_repo1)}"
gem "rack"
G
- bundle :pack
+ bundle :cache
build_gem "rack", "1.0.0", :path => bundled_app("vendor/cache") do |s|
s.write "lib/rack.rb", "raise 'omg'"
@@ -321,7 +321,7 @@ RSpec.describe "bundle install with gem sources" do
source "#{file_uri_for(gem_repo1)}"
gem "platform_specific"
G
- bundle :pack
+ bundle :cache
end
simulate_new_machine
diff --git a/spec/install/deploy_spec.rb b/spec/install/deploy_spec.rb
index 79a344eaa1..d607f8bb46 100644
--- a/spec/install/deploy_spec.rb
+++ b/spec/install/deploy_spec.rb
@@ -390,7 +390,7 @@ You have deleted from the Gemfile:
expect(the_bundle).to include_gems "foo 1.0"
bundle "config set cache_all true"
- bundle! :package
+ bundle! :cache
expect(bundled_app("vendor/cache/foo")).to be_directory
bundle! "install --local"
diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb
index 014724a292..08789820d8 100644
--- a/spec/install/gemfile/git_spec.rb
+++ b/spec/install/gemfile/git_spec.rb
@@ -1391,7 +1391,7 @@ In Gemfile:
end
G
bundle "config set cache_all true"
- bundle :package
+ bundle :cache
simulate_new_machine
bundle! "install", :env => { "PATH" => "" }
diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb
index b2861e1c00..61943ef2e5 100644
--- a/spec/install/gemfile/sources_spec.rb
+++ b/spec/install/gemfile/sources_spec.rb
@@ -102,7 +102,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
it "can cache and deploy" do
- bundle! :package
+ bundle! :cache
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/rack-obama-1.0.gem")).to exist
diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb
index df30bc0400..e291fb7917 100644
--- a/spec/lock/lockfile_spec.rb
+++ b/spec/lock/lockfile_spec.rb
@@ -621,7 +621,7 @@ RSpec.describe "the lockfile format" do
G
bundle "config set cache_all true"
- bundle! :package
+ bundle! :cache
bundle! :install, :local => true
lockfile_should_be <<-G
diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb
index b61a3f1b03..4feec14d76 100644
--- a/spec/other/platform_spec.rb
+++ b/spec/other/platform_spec.rb
@@ -781,7 +781,7 @@ G
#{ruby_version_correct}
G
- bundle :pack
+ bundle :cache
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
end
@@ -794,7 +794,7 @@ G
#{ruby_version_correct_engineless}
G
- bundle :pack
+ bundle :cache
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
end
end
@@ -806,7 +806,7 @@ G
#{ruby_version_incorrect}
G
- bundle :pack
+ bundle :cache
should_be_ruby_version_incorrect
end
@@ -817,7 +817,7 @@ G
#{engine_incorrect}
G
- bundle :pack
+ bundle :cache
should_be_engine_incorrect
end
@@ -829,7 +829,7 @@ G
#{engine_version_incorrect}
G
- bundle :pack
+ bundle :cache
should_be_engine_version_incorrect
end
end
@@ -842,7 +842,7 @@ G
#{patchlevel_incorrect}
G
- bundle :pack
+ bundle :cache
should_be_patchlevel_incorrect
end
end
diff --git a/spec/plugins/source/example_spec.rb b/spec/plugins/source/example_spec.rb
index 1ef7c2134d..64002d8f46 100644
--- a/spec/plugins/source/example_spec.rb
+++ b/spec/plugins/source/example_spec.rb
@@ -169,7 +169,7 @@ 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 "config set cache_all true"
- bundle! :package
+ bundle! :cache
expect(bundled_app("vendor/cache/a-path-gem-1.0-#{uri_hash}")).to exist