Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge #7079
Browse files Browse the repository at this point in the history
7079: Remove `bundle config` deprecations from specs r=hsbt a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that some specs still use the deprecated `bundle config interface`

### What is your fix for the problem, implemented in this PR?

My fix is to use the newer interface.

Co-authored-by: David Rodríguez <[email protected]>
  • Loading branch information
bundlerbot and deivid-rodriguez committed Mar 30, 2019
2 parents 53989a9 + 4e97ae5 commit 52e329f
Show file tree
Hide file tree
Showing 30 changed files with 82 additions and 82 deletions.
8 changes: 4 additions & 4 deletions spec/cache/gems_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@
end

context "using system gems" do
before { bundle! "config path.system true" }
before { bundle! "config set path.system true" }
it_behaves_like "when there are only gemsources"
end

context "installing into a local path" do
before { bundle! "config path ./.bundle" }
before { bundle! "config set path ./.bundle" }
it_behaves_like "when there are only gemsources"
end

Expand All @@ -97,7 +97,7 @@
end

it "uses builtin gems when installing to system gems" do
bundle! "config path.system true"
bundle! "config set path.system true"
install_gemfile %(gem 'builtin_gem', '1.0.2')
expect(the_bundle).to include_gems("builtin_gem 1.0.2")
end
Expand Down Expand Up @@ -129,7 +129,7 @@
end

it "errors if the builtin gem isn't available to cache" do
bundle! "config path.system true"
bundle! "config set path.system true"

install_gemfile <<-G
gem 'builtin_gem', '1.0.2'
Expand Down
2 changes: 1 addition & 1 deletion spec/cache/git_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
gem "foo", :git => '#{lib_path("foo-invalid")}', :branch => :master
G

bundle %(config local.foo #{lib_path("foo-1.0")})
bundle %(config set local.foo #{lib_path("foo-1.0")})
bundle "install"
bundle "#{cmd}", forgotten_command_line_options([:all, :cache_all] => true)

Expand Down
2 changes: 1 addition & 1 deletion spec/commands/check_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
end

it "uses the without setting" do
bundle! "config without foo"
bundle! "config set without foo"
install_gemfile! <<-G
source "file://#{gem_repo1}"
group :foo do
Expand Down
12 changes: 6 additions & 6 deletions spec/commands/clean_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def should_not_have_gems(*gems)
end

it "displays an error when used without --path" do
bundle! "config path.system true"
bundle! "config set path.system true"
install_gemfile <<-G
source "file://#{gem_repo1}"
Expand Down Expand Up @@ -320,7 +320,7 @@ def should_not_have_gems(*gems)
end

it "does not call clean automatically when using system gems" do
bundle! "config path.system true"
bundle! "config set path.system true"

bundle! "config list"

Expand Down Expand Up @@ -446,7 +446,7 @@ def should_not_have_gems(*gems)
end

it "does not clean on bundle update when using --system" do
bundle! "config path.system true"
bundle! "config set path.system true"

build_repo2

Expand All @@ -468,7 +468,7 @@ def should_not_have_gems(*gems)
end

it "cleans system gems when --force is used" do
bundle! "config path.system true"
bundle! "config set path.system true"

gemfile <<-G
source "file://#{gem_repo1}"
Expand Down Expand Up @@ -560,7 +560,7 @@ def should_not_have_gems(*gems)
end

it "when using --force on system gems, it doesn't remove binaries" do
bundle! "config path.system true"
bundle! "config set path.system true"

build_repo2
update_repo2 do
Expand Down Expand Up @@ -707,7 +707,7 @@ def should_not_have_gems(*gems)
gem "weakling"
G

bundle! "config auto_install 1"
bundle! "config set auto_install 1"
bundle! :clean
expect(out).to include("Installing weakling 0.0.3")
should_have_gems "thin-1.0", "rack-1.0.0", "weakling-0.0.3"
Expand Down
2 changes: 1 addition & 1 deletion spec/commands/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
bundle "config set --local gemfile #{bundled_app("NotGemfile")}"
expect(File.exist?(".bundle/config")).to eq(true)

bundle "config"
bundle "config list"
expect(out).to include("NotGemfile")
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/commands/exec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@
end

it "raises a helpful error when exec'ing to something outside of the bundle", :ruby_repo do
bundle! "config clean false" # want to keep the rackup binstub
bundle! "config set clean false" # want to keep the rackup binstub
install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "with_license"
G
[true, false].each do |l|
bundle! "config disable_exec_load #{l}"
bundle! "config set disable_exec_load #{l}"
bundle "exec rackup"
expect(last_command.stderr).to include "can't find executable rackup for gem rack. rack is not currently included in the bundle, perhaps you meant to add it to your Gemfile?"
end
Expand Down
4 changes: 2 additions & 2 deletions spec/commands/inject_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
before do
bundle "install"
if Bundler.feature_flag.bundler_2_mode?
bundle! "config --local deployment true"
bundle! "config set --local deployment true"
else
bundle! "config --local frozen true"
bundle! "config set --local frozen true"
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/commands/outdated_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def test_group_option(group = nil, gems_list_size = 1)
build_gem "activesupport", "2.3.4"
end

bundle! "config clean false"
bundle! "config set clean false"

install_gemfile <<-G
source "file://#{gem_repo2}"
Expand Down Expand Up @@ -414,7 +414,7 @@ def test_group_option(group = nil, gems_list_size = 1)
gem "foo"
G

bundle "config auto_install 1"
bundle "config set auto_install 1"
bundle :outdated
expect(out).to include("Installing foo 1.0")
end
Expand Down
2 changes: 1 addition & 1 deletion spec/commands/package_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
subject { bundle :package, forgotten_command_line_options(:frozen => true) }

it "tries to install with frozen" do
bundle! "config deployment true"
bundle! "config set deployment true"
gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
Expand Down
14 changes: 7 additions & 7 deletions spec/commands/update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
end

context "when update_requires_all_flag is set" do
before { bundle! "config update_requires_all_flag true" }
before { bundle! "config set update_requires_all_flag true" }

it "errors when passed nothing" do
install_gemfile! ""
Expand Down Expand Up @@ -133,7 +133,7 @@
describe "when a possible resolve requires an older version of a locked gem" do
context "and only_update_to_newer_versions is set" do
before do
bundle! "config only_update_to_newer_versions true"
bundle! "config set only_update_to_newer_versions true"
end

it "does not go to an older version" do
Expand Down Expand Up @@ -290,14 +290,14 @@
end

it "should suggest different command when frozen is set globally", :bundler => "< 2" do
bundle! "config --global frozen 1"
bundle! "config set --global frozen 1"
bundle "update", :all => bundle_update_requires_all?
expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m).
and match(/freeze \nby running `bundle config unset frozen`./m)
end

it "should suggest different command when frozen is set globally", :bundler => "2" do
bundle! "config --global deployment true"
bundle! "config set --global deployment true"
bundle "update", :all => bundle_update_requires_all?
expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m).
and match(/freeze \nby running `bundle config unset deployment`./m)
Expand Down Expand Up @@ -328,7 +328,7 @@
end

context "with unlock_source_unlocks_spec set to false" do
before { bundle! "config unlock_source_unlocks_spec false" }
before { bundle! "config set unlock_source_unlocks_spec false" }

it "should not update gems not included in the source that happen to have the same name" do
install_gemfile <<-G
Expand Down Expand Up @@ -598,7 +598,7 @@
end

context "with suppress_install_using_messages set" do
before { bundle! "config suppress_install_using_messages true" }
before { bundle! "config set suppress_install_using_messages true" }

it "only prints `Using` for versions that have changed" do
build_repo4 do
Expand Down Expand Up @@ -811,7 +811,7 @@

context "with patch set as default update level in config" do
it "should do a patch level update" do
bundle! "config --local prefer_patch true"
bundle! "config set --local prefer_patch true"
bundle! "update foo"

expect(the_bundle).to include_gems "foo 1.4.5", "bar 2.1.1", "qux 1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion spec/install/allow_offline_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
it "will install from the compact index" do
system_gems ["rack-1.0.0"], :path => :bundle_path

bundle! "config clean false"
bundle! "config set clean false"
install_gemfile! <<-G, :artifice => "compact_index"
source "http://testgemserver.local"
gem "rack-obama"
Expand Down
8 changes: 4 additions & 4 deletions spec/install/bundler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
end

it "can install dependencies with newer bundler version with system gems" do
bundle! "config path.system true"
bundle! "config set path.system true"
install_gemfile! <<-G
source "file://#{gem_repo2}"
gem "rails", "3.0"
Expand All @@ -139,8 +139,8 @@
end

it "can install dependencies with newer bundler version with a local path" do
bundle! "config path .bundle"
bundle! "config global_path_appends_ruby_scope true"
bundle! "config set path .bundle"
bundle! "config set global_path_appends_ruby_scope true"
install_gemfile! <<-G
source "file://#{gem_repo2}"
gem "rails", "3.0"
Expand All @@ -153,7 +153,7 @@
end

context "with allow_bundler_dependency_conflicts set" do
before { bundle! "config allow_bundler_dependency_conflicts true" }
before { bundle! "config set allow_bundler_dependency_conflicts true" }

it "are forced to the current bundler version with warnings when no compatible version is found" do
build_repo4 do
Expand Down
6 changes: 3 additions & 3 deletions spec/install/deploy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
end

context "when allow_deployment_source_credential_changes is true" do
before { bundle! "config allow_deployment_source_credential_changes true" }
before { bundle! "config set allow_deployment_source_credential_changes true" }

it "allows the replace" do
bundle :install, forgotten_command_line_options(:deployment => true)
Expand All @@ -341,7 +341,7 @@
end

context "when allow_deployment_source_credential_changes is false" do
before { bundle! "config allow_deployment_source_credential_changes false" }
before { bundle! "config set allow_deployment_source_credential_changes false" }

it "prevents the replace" do
bundle :install, forgotten_command_line_options(:deployment => true)
Expand Down Expand Up @@ -374,7 +374,7 @@
it "remembers that the bundle is frozen at runtime" do
bundle! :lock

bundle! "config deployment true"
bundle! "config set deployment true"

gemfile <<-G
source "file://#{gem_repo1}"
Expand Down
Loading

0 comments on commit 52e329f

Please sign in to comment.