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

[rubygems/rubygems] Migrate some specs to use "the new way"

The commands these specs run were throwing warnings in bundler 2, and
failing on bundler 3, effectively testing a different scenario to what
they were supposed to.

https://github.com/rubygems/rubygems/commit/97ac1ced49
This commit is contained in:
David Rodríguez 2020-06-06 18:27:42 +02:00 committed by Hiroshi SHIBATA
parent 94fc709dd1
commit 8c686475c8
Notes: git 2020-06-18 19:15:24 +09:00
4 changed files with 12 additions and 7 deletions

View file

@ -31,7 +31,7 @@ RSpec.describe "bundle cache with git" do
expect(the_bundle).to include_gems "foo 1.0" expect(the_bundle).to include_gems "foo 1.0"
end end
it "copies repository to vendor cache and uses it even when installed with bundle --path" do it "copies repository to vendor cache and uses it even when configured with `path`" do
git = build_git "foo" git = build_git "foo"
ref = git.ref_for("master", 11) ref = git.ref_for("master", 11)
@ -39,7 +39,8 @@ RSpec.describe "bundle cache with git" do
gem "foo", :git => '#{lib_path("foo-1.0")}' gem "foo", :git => '#{lib_path("foo-1.0")}'
G G
bundle "install --path vendor/bundle" bundle "config set --local path vendor/bundle"
bundle "install"
bundle "config set cache_all true" bundle "config set cache_all true"
bundle :cache bundle :cache

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "install with --deployment or --frozen" do RSpec.describe "install in deployment or frozen mode" do
before do before do
gemfile <<-G gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
@ -67,7 +67,8 @@ RSpec.describe "install with --deployment or --frozen" do
skip "doesn't find bundle" if Gem.win_platform? skip "doesn't find bundle" if Gem.win_platform?
bundle! :install bundle! :install
bundle "install --deployment" bundle "config --local deployment true"
bundle :install
bundle! "exec bundle check", :env => { "PATH" => path } bundle! "exec bundle check", :env => { "PATH" => path }
end end

View file

@ -126,7 +126,8 @@ RSpec.describe "bundle install from an existing gemspec" do
# ghost pass in future, and will only catch a regression if the message # ghost pass in future, and will only catch a regression if the message
# doesn't change. Exit codes should be used correctly (they can be more # doesn't change. Exit codes should be used correctly (they can be more
# than just 0 and 1). # than just 0 and 1).
output = bundle("install --deployment", :dir => tmp.join("foo")) bundle "config set --local deployment true"
output = bundle("install", :dir => tmp.join("foo"))
expect(output).not_to match(/You have added to the Gemfile/) expect(output).not_to match(/You have added to the Gemfile/)
expect(output).not_to match(/You have deleted from the Gemfile/) expect(output).not_to match(/You have deleted from the Gemfile/)
expect(output).not_to match(/install in deployment mode after changing/) expect(output).not_to match(/install in deployment mode after changing/)

View file

@ -124,7 +124,8 @@ RSpec.describe "bundle install with git sources" do
end end
it "still works after moving the application directory" do it "still works after moving the application directory" do
bundle "install --path vendor/bundle" bundle "config --local path vendor/bundle"
bundle "install"
FileUtils.mv bundled_app, tmp("bundled_app.bck") FileUtils.mv bundled_app, tmp("bundled_app.bck")
@ -132,7 +133,8 @@ RSpec.describe "bundle install with git sources" do
end end
it "can still install after moving the application directory" do it "can still install after moving the application directory" do
bundle "install --path vendor/bundle" bundle "config --local path vendor/bundle"
bundle "install"
FileUtils.mv bundled_app, tmp("bundled_app.bck") FileUtils.mv bundled_app, tmp("bundled_app.bck")