Skip to content

Commit

Permalink
Merge pull request #4035 from rubygems/remove_deprecations_from_spec_…
Browse files Browse the repository at this point in the history
…subcommands

Make sure specs don't run deprecated commands
  • Loading branch information
deivid-rodriguez committed Oct 28, 2020
2 parents 26b378c + efe6f29 commit b5833c6
Show file tree
Hide file tree
Showing 23 changed files with 123 additions and 123 deletions.
10 changes: 5 additions & 5 deletions bundler/spec/commands/cache_spec.rb
Expand Up @@ -221,7 +221,7 @@
end
end

bundle "config --local without wo"
bundle "config set --local without wo"
install_gemfile <<-G
source "file:#{gem_repo1}"
gem "rack"
Expand All @@ -237,7 +237,7 @@
expect(the_bundle).to include_gem "rack 1.0"
expect(the_bundle).not_to include_gems "weakling", "uninstallable"

bundle "config --local without wo"
bundle "config set --local without wo"
bundle :install
expect(the_bundle).to include_gem "rack 1.0"
expect(the_bundle).not_to include_gems "weakling", "uninstallable"
Expand All @@ -254,7 +254,7 @@
end

subject do
bundle "config --local frozen true"
bundle "config set --local frozen true"
bundle :cache, :raise_on_error => false
end

Expand Down Expand Up @@ -304,8 +304,8 @@
simulate_new_machine
FileUtils.rm_rf gem_repo2

bundle "config --local deployment true"
bundle "config --local path vendor/bundle"
bundle "config set --local deployment true"
bundle "config set --local path vendor/bundle"
bundle :install
expect(the_bundle).to include_gems "rack 1.0.0"
end
Expand Down
4 changes: 2 additions & 2 deletions bundler/spec/commands/check_spec.rb
Expand Up @@ -124,7 +124,7 @@
gem "rack", :group => :foo
G

bundle "config --local without foo"
bundle "config set --local without foo"
bundle :install

gemfile <<-G
Expand Down Expand Up @@ -217,7 +217,7 @@
gem "foo"
G

bundle "config --local deployment true"
bundle "config set --local deployment true"
bundle "install"
FileUtils.rm(bundled_app_lock)

Expand Down
4 changes: 2 additions & 2 deletions bundler/spec/commands/config_spec.rb
Expand Up @@ -45,7 +45,7 @@

it "can be moved with an environment variable" do
ENV["BUNDLE_APP_CONFIG"] = tmp("foo/bar").to_s
bundle "config --local path vendor/bundle"
bundle "config set --local path vendor/bundle"
bundle "install"

expect(bundled_app(".bundle")).not_to exist
Expand All @@ -57,7 +57,7 @@
FileUtils.mkdir_p bundled_app("omg")

ENV["BUNDLE_APP_CONFIG"] = "../foo"
bundle "config --local path vendor/bundle"
bundle "config set --local path vendor/bundle"
bundle "install", :dir => bundled_app("omg")

expect(bundled_app(".bundle")).not_to exist
Expand Down
2 changes: 1 addition & 1 deletion bundler/spec/commands/exec_spec.rb
Expand Up @@ -269,7 +269,7 @@
end

it "handles gems installed with --without" do
bundle "config --local without middleware"
bundle "config set --local without middleware"
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gem "rack" # rack 0.9.1 and 1.0 exist
Expand Down
6 changes: 3 additions & 3 deletions bundler/spec/commands/install_spec.rb
Expand Up @@ -291,7 +291,7 @@
end

it "works" do
bundle "config --local path vendor"
bundle "config set --local path vendor"
bundle "install"
expect(the_bundle).to include_gems "rack 1.0"
end
Expand Down Expand Up @@ -591,7 +591,7 @@
it "should display a proper message to explain the problem" do
FileUtils.chmod(0o500, bundled_app("vendor"))

bundle "config --local path vendor"
bundle "config set --local path vendor"
bundle :install, :raise_on_error => false
expect(err).to include(bundled_app("vendor").to_s)
expect(err).to include("grant write permissions")
Expand All @@ -604,7 +604,7 @@
source "#{file_uri_for(gem_repo1)}"
gem "rack"
G
bundle "config --local path bundle"
bundle "config set --local path bundle"
bundle "install", :standalone => true
end

Expand Down
30 changes: 15 additions & 15 deletions bundler/spec/commands/post_bundle_message_spec.rb
Expand Up @@ -29,21 +29,21 @@
expect(out).to include(bundle_complete_message)
expect(out).to include(installed_gems_stats)

bundle "config --local without emo"
bundle "config set --local without emo"
bundle :install
expect(out).to include(bundle_show_message)
expect(out).to include("Gems in the group emo were not installed")
expect(out).to include(bundle_complete_message)
expect(out).to include(installed_gems_stats)

bundle "config --local without emo test"
bundle "config set --local without emo test"
bundle :install
expect(out).to include(bundle_show_message)
expect(out).to include("Gems in the groups emo and test were not installed")
expect(out).to include(bundle_complete_message)
expect(out).to include("4 Gemfile dependencies, 3 gems now installed.")

bundle "config --local without emo obama test"
bundle "config set --local without emo obama test"
bundle :install
expect(out).to include(bundle_show_message)
expect(out).to include("Gems in the groups emo, obama and test were not installed")
Expand All @@ -55,28 +55,28 @@
let(:bundle_path) { "./vendor" }

it "shows proper messages according to the configured groups" do
bundle "config --local path vendor"
bundle "config set --local path vendor"
bundle :install
expect(out).to include(bundle_show_path_message)
expect(out).to_not include("Gems in the group")
expect(out).to include(bundle_complete_message)

bundle "config --local path vendor"
bundle "config --local without emo"
bundle "config set --local path vendor"
bundle "config set --local without emo"
bundle :install
expect(out).to include(bundle_show_path_message)
expect(out).to include("Gems in the group emo were not installed")
expect(out).to include(bundle_complete_message)

bundle "config --local path vendor"
bundle "config --local without emo test"
bundle "config set --local path vendor"
bundle "config set --local without emo test"
bundle :install
expect(out).to include(bundle_show_path_message)
expect(out).to include("Gems in the groups emo and test were not installed")
expect(out).to include(bundle_complete_message)

bundle "config --local path vendor"
bundle "config --local without emo obama test"
bundle "config set --local path vendor"
bundle "config set --local without emo obama test"
bundle :install
expect(out).to include(bundle_show_path_message)
expect(out).to include("Gems in the groups emo, obama and test were not installed")
Expand All @@ -88,7 +88,7 @@
let(:bundle_path) { bundled_app("cache") }

it "shows proper messages according to the configured groups" do
bundle "config --local path #{bundle_path}"
bundle "config set --local path #{bundle_path}"
bundle :install
expect(out).to include("Bundled gems are installed into `./cache`")
expect(out).to_not include("Gems in the group")
Expand All @@ -100,7 +100,7 @@
let(:bundle_path) { tmp("not_bundled_app") }

it "shows proper messages according to the configured groups" do
bundle "config --local path #{bundle_path}"
bundle "config set --local path #{bundle_path}"
bundle :install
expect(out).to include("Bundled gems are installed into `#{tmp("not_bundled_app")}`")
expect(out).to_not include("Gems in the group")
Expand Down Expand Up @@ -193,19 +193,19 @@
expect(out).not_to include("Gems in the groups")
expect(out).to include(bundle_updated_message)

bundle "config --local without emo"
bundle "config set --local without emo"
bundle :install
bundle :update, :all => true
expect(out).to include("Gems in the group emo were not updated")
expect(out).to include(bundle_updated_message)

bundle "config --local without emo test"
bundle "config set --local without emo test"
bundle :install
bundle :update, :all => true
expect(out).to include("Gems in the groups emo and test were not updated")
expect(out).to include(bundle_updated_message)

bundle "config --local without emo obama test"
bundle "config set --local without emo obama test"
bundle :install
bundle :update, :all => true
expect(out).to include("Gems in the groups emo, obama and test were not updated")
Expand Down
38 changes: 19 additions & 19 deletions bundler/spec/install/deploy_spec.rb
Expand Up @@ -44,8 +44,8 @@
it "still works if you are not in the app directory and specify --gemfile" do
bundle "install"
simulate_new_machine
bundle "config --local deployment true"
bundle "config --local path vendor/bundle"
bundle "config set --local deployment true"
bundle "config set --local path vendor/bundle"
bundle "install --gemfile #{tmp}/bundled_app/Gemfile", :dir => tmp
expect(the_bundle).to include_gems "rack 1.0"
end
Expand All @@ -58,16 +58,16 @@
end
G
bundle :install
bundle "config --local deployment true"
bundle "config --local without test"
bundle "config set --local deployment true"
bundle "config set --local without test"
bundle :install
end

it "works when you bundle exec bundle" do
skip "doesn't find bundle" if Gem.win_platform?

bundle :install
bundle "config --local deployment true"
bundle "config set --local deployment true"
bundle :install
bundle "exec bundle check", :env => { "PATH" => path }
end
Expand All @@ -81,7 +81,7 @@
G

bundle :install
bundle "config --local deployment true"
bundle "config set --local deployment true"
bundle :install
end

Expand All @@ -92,7 +92,7 @@
gem "rack-obama", ">= 1.0"
G

bundle "config --local deployment true"
bundle "config set --local deployment true"
bundle :install, :artifice => "endpoint_strict_basic_authentication"
end

Expand All @@ -103,15 +103,15 @@
end
G

bundle "config --local deployment true"
bundle "config set --local deployment true"
bundle :install

expect(the_bundle).to include_gems "rack 1.0"
end

context "when replacing a host with the same host with credentials" do
before do
bundle "config --local path vendor/bundle"
bundle "config set --local path vendor/bundle"
bundle "install"
gemfile <<-G
source "http://user_name:password@localgemserver.test/"
Expand Down Expand Up @@ -215,7 +215,7 @@
gem "rack-obama"
G

bundle "config --local deployment true"
bundle "config set --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("deployment mode")
expect(err).to include("You have added to the Gemfile")
Expand All @@ -234,9 +234,9 @@
expect(the_bundle).to include_gems "path_gem 1.0"
FileUtils.rm_r lib_path("path_gem-1.0")

bundle "config --local path .bundle"
bundle "config --local without development"
bundle "config --local deployment true"
bundle "config set --local path .bundle"
bundle "config set --local without development"
bundle "config set --local deployment true"
bundle :install, :env => { "DEBUG" => "1" }
run "puts :WIN"
expect(out).to eq("WIN")
Expand All @@ -252,8 +252,8 @@
expect(the_bundle).to include_gems "path_gem 1.0"
FileUtils.rm_r lib_path("path_gem-1.0")

bundle "config --local path .bundle"
bundle "config --local deployment true"
bundle "config set --local path .bundle"
bundle "config set --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("The path `#{lib_path("path_gem-1.0")}` does not exist.")
end
Expand Down Expand Up @@ -324,7 +324,7 @@
gem "activesupport"
G

bundle "config --local deployment true"
bundle "config set --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("deployment mode")
expect(err).to include("You have added to the Gemfile:\n* activesupport\n\n")
Expand All @@ -338,7 +338,7 @@
gem "rack", :git => "git://hubz.com"
G

bundle "config --local deployment true"
bundle "config set --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("deployment mode")
expect(err).to include("You have added to the Gemfile:\n* source: git://hubz.com (at master)")
Expand All @@ -358,7 +358,7 @@
gem "rack"
G

bundle "config --local deployment true"
bundle "config set --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("deployment mode")
# The drive letter of the Windows environment is fragile value in GitHub Actions
Expand All @@ -385,7 +385,7 @@
gem "foo", :git => "#{lib_path("rack")}"
G

bundle "config --local deployment true"
bundle "config set --local deployment true"
bundle :install, :raise_on_error => false
expect(err).to include("deployment mode")
# The drive letter of the Windows environment is fragile value in GitHub Actions
Expand Down
2 changes: 1 addition & 1 deletion bundler/spec/install/gemfile/eval_gemfile_spec.rb
Expand Up @@ -47,7 +47,7 @@
# parsed lockfile and the evaluated gemfile.
it "bundles with deployment mode configured" do
bundle :install
bundle "config --local deployment true"
bundle "config set --local deployment true"
bundle :install
end
end
Expand Down
4 changes: 2 additions & 2 deletions bundler/spec/install/gemfile/gemspec_spec.rb
Expand Up @@ -291,7 +291,7 @@
s.add_dependency "activesupport", ">= 1.0.1"
end

bundle "config --local deployment true"
bundle "config set --local deployment true"
bundle :install, :raise_on_error => false

expect(err).to include("changed")
Expand Down Expand Up @@ -560,7 +560,7 @@
it "installs the ruby platform gemspec and skips dev deps with `without development` configured" do
simulate_platform "ruby"

bundle "config --local without development"
bundle "config set --local without development"
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
Expand Down

0 comments on commit b5833c6

Please sign in to comment.