summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-04-01 14:23:59 +0000
committerColby Swandale <me@colby.fyi>2019-04-08 22:05:03 +1000
commitb2c910cbb98a94c44d044678229413e54960642f (patch)
tree4f984dce29895ae4438a2d3392f3ed5e686cc48d
parent1fd59fa141ae04f8804618c86473daec880fa3e7 (diff)
downloadbundler-b2c910cbb98a94c44d044678229413e54960642f.tar.gz
Merge #7080
7080: Always pass the `--all` flag when needed r=deivid-rodriguez a=deivid-rodriguez The problem was that some specs were still using `bundle update` to update all gems, which is deprecated. My fix is to update all specs to use the new preferred command, namely, `bundle update --all`. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> (cherry picked from commit 63cc70aa2573345ebfb6bddaeef0b9d465591dd9) (cherry picked from commit e423c83f1f6bccbfc992bca7aef2ad31d6449d75)
-rw-r--r--spec/cache/gems_spec.rb2
-rw-r--r--spec/cache/git_spec.rb2
-rw-r--r--spec/cache/platform_spec.rb2
-rw-r--r--spec/commands/clean_spec.rb8
-rw-r--r--spec/commands/package_spec.rb2
-rw-r--r--spec/commands/update_spec.rb30
-rw-r--r--spec/install/gemfile/git_spec.rb8
-rw-r--r--spec/install/gems/compact_index_spec.rb2
-rw-r--r--spec/install/gems/dependency_api_spec.rb2
-rw-r--r--spec/install/git_spec.rb2
-rw-r--r--spec/install/post_bundle_message_spec.rb8
-rw-r--r--spec/other/platform_spec.rb12
-rw-r--r--spec/realworld/parallel_spec.rb2
-rw-r--r--spec/support/helpers.rb4
-rw-r--r--spec/update/gemfile_spec.rb8
-rw-r--r--spec/update/gems/post_install_spec.rb4
-rw-r--r--spec/update/git_spec.rb8
17 files changed, 51 insertions, 55 deletions
diff --git a/spec/cache/gems_spec.rb b/spec/cache/gems_spec.rb
index 4a0b953830..281e030c8f 100644
--- a/spec/cache/gems_spec.rb
+++ b/spec/cache/gems_spec.rb
@@ -196,7 +196,7 @@ RSpec.describe "bundle cache" do
it "adds and removes when gems are updated" do
update_repo2
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(cached_gem("rack-1.2")).to exist
expect(cached_gem("rack-1.0.0")).not_to exist
end
diff --git a/spec/cache/git_spec.rb b/spec/cache/git_spec.rb
index 33387dbbb2..186b0269ab 100644
--- a/spec/cache/git_spec.rb
+++ b/spec/cache/git_spec.rb
@@ -81,7 +81,7 @@ end
ref = git.ref_for("master", 11)
expect(ref).not_to eq(old_ref)
- bundle! "update", :all => bundle_update_requires_all?
+ bundle! "update", :all => true
bundle! "#{cmd}", forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
diff --git a/spec/cache/platform_spec.rb b/spec/cache/platform_spec.rb
index c0622a3c94..b3c4643ef5 100644
--- a/spec/cache/platform_spec.rb
+++ b/spec/cache/platform_spec.rb
@@ -41,7 +41,7 @@ RSpec.describe "bundle cache with multiple platforms" do
end
it "ensures that a successful bundle update does not delete gems for other platforms" do
- bundle! "update", :all => bundle_update_requires_all?
+ bundle! "update", :all => true
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/activesupport-2.3.5.gem")).to exist
diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb
index e1f007fc35..6addd36c32 100644
--- a/spec/commands/clean_spec.rb
+++ b/spec/commands/clean_spec.rb
@@ -201,7 +201,7 @@ RSpec.describe "bundle clean" do
update_git "foo", :path => lib_path("foo-bar")
revision2 = revision_for(lib_path("foo-bar"))
- bundle! "update", :all => bundle_update_requires_all?
+ bundle! "update", :all => true
bundle! :clean
expect(out).to include("Removing foo-bar (#{revision[0..11]})")
@@ -378,7 +378,7 @@ RSpec.describe "bundle clean" do
build_gem "foo", "1.0.1"
end
- bundle! "update", :all => bundle_update_requires_all?
+ bundle! "update", :all => true
should_have_gems "foo-1.0.1"
should_not_have_gems "foo-1.0"
@@ -441,7 +441,7 @@ RSpec.describe "bundle clean" do
build_gem "foo", "1.0.1"
end
- bundle! :update, :all => bundle_update_requires_all?
+ bundle! :update, :all => true
should_have_gems "foo-1.0", "foo-1.0.1"
end
@@ -460,7 +460,7 @@ RSpec.describe "bundle clean" do
update_repo2 do
build_gem "foo", "1.0.1"
end
- bundle! :update, :all => bundle_update_requires_all?
+ bundle! :update, :all => true
gem = ruby_core? ? ENV["BUNDLE_GEM"] : "gem"
sys_exec! "#{gem} list"
diff --git a/spec/commands/package_spec.rb b/spec/commands/package_spec.rb
index 083e636576..0159558975 100644
--- a/spec/commands/package_spec.rb
+++ b/spec/commands/package_spec.rb
@@ -187,7 +187,7 @@ RSpec.describe "bundle package" do
D
bundle! "package --no-install"
- bundle! "update"
+ bundle! "update --all"
expect(the_bundle).to include_gems "rack 1.0.0"
end
diff --git a/spec/commands/update_spec.rb b/spec/commands/update_spec.rb
index 786719f50d..9b8aec9fcb 100644
--- a/spec/commands/update_spec.rb
+++ b/spec/commands/update_spec.rb
@@ -65,7 +65,7 @@ RSpec.describe "bundle update" do
gem "rack", "1.0"
G
- bundle! "update --gemfile OmgFile", :all => bundle_update_requires_all?
+ bundle! "update --gemfile OmgFile", :all => true
expect(bundled_app("OmgFile.lock")).to exist
end
@@ -167,7 +167,7 @@ RSpec.describe "bundle update" do
end
end
- bundle! "update", :all => bundle_update_requires_all?
+ bundle! "update", :all => true
expect(the_bundle).to include_gems("slim 3.0.9", "slim-rails 3.1.3", "slim_lint 0.16.1")
end
@@ -282,7 +282,7 @@ RSpec.describe "bundle update" do
describe "in a frozen bundle" do
it "should fail loudly", :bundler => "< 3" do
bundle! "install --deployment"
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(last_command).to be_failure
expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m)
@@ -291,15 +291,15 @@ RSpec.describe "bundle update" do
it "should suggest different command when frozen is set globally", :bundler => "< 3" do
bundle! "config --global frozen 1"
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m).
and match(/freeze \nby running `bundle config --delete frozen`./m)
end
it "should suggest different command when frozen is set globally", :bundler => "3" do
bundle! "config --global deployment true"
- bundle "update", :all => bundle_update_requires_all?
- expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m).
+ bundle "update", :all => true
+ expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m).
and match(/freeze \nby running `bundle config --delete deployment`./m)
end
end
@@ -542,7 +542,7 @@ RSpec.describe "bundle update without a Gemfile.lock" do
gem "rack", "1.0"
G
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(the_bundle).to include_gems "rack 1.0.0"
end
@@ -563,7 +563,7 @@ RSpec.describe "bundle update when a gem depends on a newer version of bundler"
end
it "should explain that bundler conflicted", :bundler => "< 3" do
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(last_command.stdboth).not_to match(/in snapshot/i)
expect(last_command.bundler_err).to match(/current Bundler version/i).
and match(/perhaps you need to update bundler/i)
@@ -586,14 +586,14 @@ RSpec.describe "bundle update" do
gem "activesupport"
G
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(out).to include("Using activesupport 2.3.5")
update_repo2 do
build_gem "activesupport", "3.0"
end
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(out).to include("Installing activesupport 3.0 (was 2.3.5)")
end
@@ -612,7 +612,7 @@ RSpec.describe "bundle update" do
gem "foo"
G
- bundle! "update", :all => bundle_update_requires_all?
+ bundle! "update", :all => true
out.gsub!(/RubyGems [\d\.]+ is not threadsafe.*\n?/, "")
expect(out).to include "Resolving dependencies...\nBundle updated!"
@@ -620,7 +620,7 @@ RSpec.describe "bundle update" do
build_gem "foo", "2.0"
end
- bundle! "update", :all => bundle_update_requires_all?
+ bundle! "update", :all => true
out.sub!("Removing foo (1.0)\n", "")
out.gsub!(/RubyGems [\d\.]+ is not threadsafe.*\n?/, "")
expect(out).to include strip_whitespace(<<-EOS).strip
@@ -817,7 +817,7 @@ RSpec.describe "bundle update conservative" do
end
it "update all" do
- bundle! "update --patch", :all => bundle_update_requires_all?
+ bundle! "update --patch", :all => true
expect(the_bundle).to include_gems "foo 1.4.5", "bar 2.1.1", "qux 1.0.1"
end
@@ -839,7 +839,7 @@ RSpec.describe "bundle update conservative" do
end
it "minor preferred" do
- bundle! "update --minor --strict", :all => bundle_update_requires_all?
+ bundle! "update --minor --strict", :all => true
expect(the_bundle).to include_gems "foo 1.5.0", "bar 2.1.1", "qux 1.1.0"
end
@@ -936,7 +936,7 @@ RSpec.describe "bundle update conservative" do
end
it "raises if too many flags are provided" do
- bundle "update --patch --minor", :all => bundle_update_requires_all?
+ bundle "update --patch --minor", :all => true
expect(last_command.bundler_err).to eq "Provide only one of the following options: minor, patch"
end
diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb
index fe396c7a0f..a4af90318f 100644
--- a/spec/install/gemfile/git_spec.rb
+++ b/spec/install/gemfile/git_spec.rb
@@ -294,7 +294,7 @@ RSpec.describe "bundle install with git sources" do
G
# ensure we also git fetch after cloning
- bundle! :update, :all => bundle_update_requires_all?
+ bundle! :update, :all => true
Dir.chdir(Dir[home(".bundle/cache/git/foo-*")].first) do
sys_exec("git ls-remote .")
@@ -798,14 +798,14 @@ RSpec.describe "bundle install with git sources" do
s.write "lib/forced.rb", "FORCED = '1.1'"
end
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(the_bundle).to include_gems "forced 1.1"
Dir.chdir(lib_path("forced-1.0")) do
`git reset --hard HEAD^`
end
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(the_bundle).to include_gems "forced 1.0"
end
@@ -1268,7 +1268,7 @@ In Gemfile:
G
with_path_as("") do
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
end
expect(last_command.bundler_err).
to include("You need to install git to be able to use gems from git repositories. For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git")
diff --git a/spec/install/gems/compact_index_spec.rb b/spec/install/gems/compact_index_spec.rb
index 2acade1166..123056fb02 100644
--- a/spec/install/gems/compact_index_spec.rb
+++ b/spec/install/gems/compact_index_spec.rb
@@ -247,7 +247,7 @@ The checksum of /versions does not match the checksum provided by the server! So
gem "rack"
G
- bundle! "update --full-index", :artifice => "compact_index", :all => bundle_update_requires_all?
+ bundle! "update --full-index", :artifice => "compact_index", :all => true
expect(out).to include("Fetching source index from #{source_uri}")
expect(the_bundle).to include_gems "rack 1.0.0"
end
diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb
index 3cb98db1eb..86b4f59b7a 100644
--- a/spec/install/gems/dependency_api_spec.rb
+++ b/spec/install/gems/dependency_api_spec.rb
@@ -237,7 +237,7 @@ RSpec.describe "gemcutter's dependency API" do
gem "rack"
G
- bundle! "update --full-index", :artifice => "endpoint", :all => bundle_update_requires_all?
+ bundle! "update --full-index", :artifice => "endpoint", :all => true
expect(out).to include("Fetching source index from #{source_uri}")
expect(the_bundle).to include_gems "rack 1.0.0"
end
diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb
index 48086a86c7..68b2f47c10 100644
--- a/spec/install/git_spec.rb
+++ b/spec/install/git_spec.rb
@@ -31,7 +31,7 @@ RSpec.describe "bundle install" do
update_git "foo", "4.0", :path => lib_path("foo"), :gemspec => true
- bundle! :update, :all => bundle_update_requires_all?
+ bundle! :update, :all => true
expect(out).to include("Using foo 2.0 (was 1.0) from #{lib_path("foo")} (at master~2@#{rev2})")
expect(the_bundle).to include_gems "foo 2.0", :source => "git@#{lib_path("foo")}"
end
diff --git a/spec/install/post_bundle_message_spec.rb b/spec/install/post_bundle_message_spec.rb
index 394134f523..5ab552385e 100644
--- a/spec/install/post_bundle_message_spec.rb
+++ b/spec/install/post_bundle_message_spec.rb
@@ -177,28 +177,28 @@ The source does not contain any versions of 'not-a-gem'
describe "for bundle update" do
it "without any options" do
- bundle! :update, :all => bundle_update_requires_all?
+ bundle! :update, :all => true
expect(out).not_to include("Gems in the groups")
expect(out).to include(bundle_updated_message)
end
it "with --without one group" do
bundle! :install, forgotten_command_line_options(:without => "emo")
- bundle! :update, :all => bundle_update_requires_all?
+ bundle! :update, :all => true
expect(out).to include("Gems in the group emo were not installed")
expect(out).to include(bundle_updated_message)
end
it "with --without two groups" do
bundle! :install, forgotten_command_line_options(:without => "emo test")
- bundle! :update, :all => bundle_update_requires_all?
+ bundle! :update, :all => true
expect(out).to include("Gems in the groups emo and test were not installed")
expect(out).to include(bundle_updated_message)
end
it "with --without more groups" do
bundle! :install, forgotten_command_line_options(:without => "emo obama test")
- bundle! :update, :all => bundle_update_requires_all?
+ bundle! :update, :all => true
expect(out).to include("Gems in the groups emo, obama and test were not installed")
expect(out).to include(bundle_updated_message)
end
diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb
index 6c59fd893c..2196cd4e18 100644
--- a/spec/other/platform_spec.rb
+++ b/spec/other/platform_spec.rb
@@ -511,7 +511,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(the_bundle).to include_gems "rack 1.2", "rack-obama 1.0", "activesupport 3.0"
end
@@ -528,7 +528,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(the_bundle).to include_gems "rack 1.2", "rack-obama 1.0", "activesupport 3.0"
end
end
@@ -545,7 +545,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle :update, :all => bundle_update_requires_all?
+ bundle :update, :all => true
should_be_ruby_version_incorrect
end
@@ -561,7 +561,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle :update, :all => bundle_update_requires_all?
+ bundle :update, :all => true
should_be_engine_incorrect
end
@@ -578,7 +578,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle :update, :all => bundle_update_requires_all?
+ bundle :update, :all => true
should_be_engine_version_incorrect
end
end
@@ -594,7 +594,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle :update, :all => bundle_update_requires_all?
+ bundle :update, :all => true
should_be_patchlevel_incorrect
end
end
diff --git a/spec/realworld/parallel_spec.rb b/spec/realworld/parallel_spec.rb
index ed4430c68b..b735cd3f77 100644
--- a/spec/realworld/parallel_spec.rb
+++ b/spec/realworld/parallel_spec.rb
@@ -38,7 +38,7 @@ RSpec.describe "parallel", :realworld => true, :sometimes => true do
gem 'i18n', '~> 0.6.0' # Because 0.7+ requires Ruby 1.9.3+
G
- bundle :update, :jobs => 4, :env => { "DEBUG" => "1" }, :all => bundle_update_requires_all?
+ bundle :update, :jobs => 4, :env => { "DEBUG" => "1" }, :all => true
if Bundler.rubygems.provides?(">= 2.1.0")
expect(out).to match(/[1-3]: /)
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 0c018c6c68..8af2b1ff2d 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -52,10 +52,6 @@ module Spec
last_command.exitstatus
end
- def bundle_update_requires_all?
- Bundler::VERSION.start_with?("2.") ? nil : true
- end
-
def in_app_root(&blk)
Dir.chdir(bundled_app, &blk)
end
diff --git a/spec/update/gemfile_spec.rb b/spec/update/gemfile_spec.rb
index f59f3a2d32..b9f4328684 100644
--- a/spec/update/gemfile_spec.rb
+++ b/spec/update/gemfile_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe "bundle update" do
G
bundle! :install, :gemfile => bundled_app("NotGemfile")
- bundle! :update, :gemfile => bundled_app("NotGemfile"), :all => bundle_update_requires_all?
+ bundle! :update, :gemfile => bundled_app("NotGemfile"), :all => true
# Specify BUNDLE_GEMFILE for `the_bundle`
# to retrieve the proper Gemfile
@@ -30,7 +30,7 @@ RSpec.describe "bundle update" do
end
it "uses the gemfile to update" do
- bundle! "update", :all => bundle_update_requires_all?
+ bundle! "update", :all => true
bundle "list"
expect(out).to include("rack (1.0.0)")
@@ -39,7 +39,7 @@ RSpec.describe "bundle update" do
it "uses the gemfile while in a subdirectory" do
bundled_app("subdir").mkpath
Dir.chdir(bundled_app("subdir")) do
- bundle! "update", :all => bundle_update_requires_all?
+ bundle! "update", :all => true
bundle "list"
expect(out).to include("rack (1.0.0)")
@@ -55,7 +55,7 @@ RSpec.describe "bundle update" do
create_file("Gemfile", "raise 'wrong Gemfile!'")
bundle! :install
- bundle! :update, :all => bundle_update_requires_all?
+ bundle! :update, :all => true
expect(bundled_app("gems.rb")).to be_file
expect(bundled_app("Gemfile.lock")).not_to be_file
diff --git a/spec/update/gems/post_install_spec.rb b/spec/update/gems/post_install_spec.rb
index 2fb3547806..fe411a8a6f 100644
--- a/spec/update/gems/post_install_spec.rb
+++ b/spec/update/gems/post_install_spec.rb
@@ -52,7 +52,7 @@ RSpec.describe "bundle update" do
gem 'thin'
G
- bundle! :update, :all => bundle_update_requires_all?
+ bundle! :update, :all => true
end
it_behaves_like "a post-install message outputter"
@@ -67,7 +67,7 @@ RSpec.describe "bundle update" do
gem 'thin'
G
- bundle! :update, :all => bundle_update_requires_all?
+ bundle! :update, :all => true
end
it_behaves_like "a post-install message outputter"
diff --git a/spec/update/git_spec.rb b/spec/update/git_spec.rb
index d97760e84b..19abceb08d 100644
--- a/spec/update/git_spec.rb
+++ b/spec/update/git_spec.rb
@@ -16,7 +16,7 @@ RSpec.describe "bundle update" do
s.write "lib/foo.rb", "FOO = '1.1'"
end
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(the_bundle).to include_gems "foo 1.1"
end
@@ -111,7 +111,7 @@ RSpec.describe "bundle update" do
gem 'foo', :git => "#{@remote.path}", :tag => "fubar"
G
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(exitstatus).to eq(0) if exitstatus
end
@@ -191,7 +191,7 @@ RSpec.describe "bundle update" do
lib_path("foo-1.0").join(".git").rmtree
- bundle :update, :all => bundle_update_requires_all?
+ bundle :update, :all => true
expect(last_command.bundler_err).to include(lib_path("foo-1.0").to_s).
and match(/Git error: command `git fetch.+has failed/)
end
@@ -233,7 +233,7 @@ RSpec.describe "bundle update" do
rails!
G
- bundle "update", :all => bundle_update_requires_all?
+ bundle "update", :all => true
expect(out).to include("Using rails 3.0 (was 2.3.2) from #{lib_path("rails")} (at master@#{revision_for(lib_path("rails"))[0..6]})")
end
end