diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-15 21:31:12 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-22 20:32:30 +0900 |
commit | c7ebeb7eda9f7f6bbb48effe1efc026eeb64d09c (patch) | |
tree | b516b3b5119331d4d8431b4d17f552e2c8e798fe /spec/bundler/install | |
parent | f4f157fc81b940c0f76a01ee266a08e6bba69b6b (diff) |
Sync Bundler PR #3624
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3114
Diffstat (limited to 'spec/bundler/install')
-rw-r--r-- | spec/bundler/install/bundler_spec.rb | 8 | ||||
-rw-r--r-- | spec/bundler/install/deploy_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/install/gemfile/gemspec_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/install/gemfile/git_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/install/gemfile/groups_spec.rb | 19 | ||||
-rw-r--r-- | spec/bundler/install/gems/compact_index_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/install/gems/dependency_api_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/install/gems/native_extensions_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/install/gems/standalone_spec.rb | 14 | ||||
-rw-r--r-- | spec/bundler/install/gems/sudo_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/install/global_cache_spec.rb | 14 | ||||
-rw-r--r-- | spec/bundler/install/path_spec.rb | 2 |
12 files changed, 41 insertions, 36 deletions
diff --git a/spec/bundler/install/bundler_spec.rb b/spec/bundler/install/bundler_spec.rb index 25cc12160c..7c9b1a016d 100644 --- a/spec/bundler/install/bundler_spec.rb +++ b/spec/bundler/install/bundler_spec.rb @@ -136,12 +136,12 @@ RSpec.describe "bundle install" do system_gems "bundler-99999999.99.1" - install_gemfile! <<-G, :system_bundler => true + install_gemfile! <<-G source "#{file_uri_for(gem_repo2)}" gem "rails", "3.0" G - bundle! "check", :system_bundler => true + bundle! "check" expect(out).to include("The Gemfile's dependencies are satisfied") end @@ -150,12 +150,12 @@ RSpec.describe "bundle install" do system_gems "bundler-99999999.99.1" - install_gemfile! <<-G, :system_bundler => true + install_gemfile! <<-G source "#{file_uri_for(gem_repo2)}" gem "rails", "3.0" G - bundle! "check", :system_bundler => true + bundle! "check" expect(out).to include("The Gemfile's dependencies are satisfied") end diff --git a/spec/bundler/install/deploy_spec.rb b/spec/bundler/install/deploy_spec.rb index 121b99fd8c..071c6fcfcc 100644 --- a/spec/bundler/install/deploy_spec.rb +++ b/spec/bundler/install/deploy_spec.rb @@ -68,7 +68,7 @@ RSpec.describe "install with --deployment or --frozen" do bundle! :install bundle "install --deployment" - bundle! "exec bundle check" + bundle! "exec bundle check", :env => { "PATH" => path } end it "works when using path gems from the same path and the version is specified" do diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb index b42587c65f..1c1924cc2a 100644 --- a/spec/bundler/install/gemfile/gemspec_spec.rb +++ b/spec/bundler/install/gemfile/gemspec_spec.rb @@ -172,7 +172,7 @@ RSpec.describe "bundle install from an existing gemspec" do s.add_dependency "platform_specific" end - system_gems "platform_specific-1.0-java", :path => default_bundle_path, :keep_path => true + system_gems "platform_specific-1.0-java", :path => default_bundle_path install_gemfile! <<-G gemspec :path => '#{tmp.join("foo")}' @@ -420,6 +420,8 @@ RSpec.describe "bundle install from an existing gemspec" do end end + bundle "config specific_platform false" + %w[ruby jruby].each do |platform| simulate_platform(platform) do install_gemfile <<-G diff --git a/spec/bundler/install/gemfile/git_spec.rb b/spec/bundler/install/gemfile/git_spec.rb index fd5cde4fb1..6cfab1b89c 100644 --- a/spec/bundler/install/gemfile/git_spec.rb +++ b/spec/bundler/install/gemfile/git_spec.rb @@ -1139,7 +1139,7 @@ RSpec.describe "bundle install with git sources" do expect(out).to include(Pathname.glob(default_bundle_path("bundler/gems/extensions/**/foo-1.0-*")).first.to_s) end - it "does not use old extension after ref changes", :ruby_repo do + it "does not use old extension after ref changes" do git_reader = build_git "foo", :no_default => true do |s| s.extensions = ["ext/extconf.rb"] s.write "ext/extconf.rb", <<-RUBY diff --git a/spec/bundler/install/gemfile/groups_spec.rb b/spec/bundler/install/gemfile/groups_spec.rb index 63be1a4e43..4ae4eb1862 100644 --- a/spec/bundler/install/gemfile/groups_spec.rb +++ b/spec/bundler/install/gemfile/groups_spec.rb @@ -352,16 +352,17 @@ RSpec.describe "bundle install with groups" do describe "when locked and installed with --without" do before(:each) do build_repo2 - system_gems "rack-0.9.1" do - install_gemfile <<-G, forgotten_command_line_options(:without => "rack") - source "#{file_uri_for(gem_repo2)}" - gem "rack" - group :rack do - gem "rack_middleware" - end - G - end + system_gems "rack-0.9.1" + + install_gemfile <<-G, forgotten_command_line_options(:without => "rack") + source "#{file_uri_for(gem_repo2)}" + gem "rack" + + group :rack do + gem "rack_middleware" + end + G end it "uses the correct versions even if --without was used on the original" do diff --git a/spec/bundler/install/gems/compact_index_spec.rb b/spec/bundler/install/gems/compact_index_spec.rb index 2452d82667..4760d135e6 100644 --- a/spec/bundler/install/gems/compact_index_spec.rb +++ b/spec/bundler/install/gems/compact_index_spec.rb @@ -410,7 +410,7 @@ The checksum of /versions does not match the checksum provided by the server! So api_request_limit = low_api_request_limit_for(gem_repo2) - install_gemfile! <<-G, :artifice => "compact_index_extra_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s } + install_gemfile! <<-G, :artifice => "compact_index_extra_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s }.merge(env_for_missing_prerelease_default_gem_activation) source "#{source_uri}" source "#{source_uri}/extra" do gem "back_deps" @@ -432,7 +432,7 @@ The checksum of /versions does not match the checksum provided by the server! So api_request_limit = low_api_request_limit_for(gem_repo4) - install_gemfile! <<-G, :artifice => "compact_index_extra_api_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s } + install_gemfile! <<-G, :artifice => "compact_index_extra_api_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s }.merge(env_for_missing_prerelease_default_gem_activation) source "#{source_uri}" source "#{source_uri}/extra" do gem "back_deps" diff --git a/spec/bundler/install/gems/dependency_api_spec.rb b/spec/bundler/install/gems/dependency_api_spec.rb index 863966a0e1..d1af4d7ed7 100644 --- a/spec/bundler/install/gems/dependency_api_spec.rb +++ b/spec/bundler/install/gems/dependency_api_spec.rb @@ -384,7 +384,7 @@ RSpec.describe "gemcutter's dependency API" do api_request_limit = low_api_request_limit_for(gem_repo2) - install_gemfile! <<-G, :artifice => "endpoint_extra_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s } + install_gemfile! <<-G, :artifice => "endpoint_extra_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s }.merge(env_for_missing_prerelease_default_gem_activation) source "#{source_uri}" source "#{source_uri}/extra" gem "back_deps" @@ -405,7 +405,7 @@ RSpec.describe "gemcutter's dependency API" do api_request_limit = low_api_request_limit_for(gem_repo2) - install_gemfile! <<-G, :artifice => "endpoint_extra_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s } + install_gemfile! <<-G, :artifice => "endpoint_extra_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s }.merge(env_for_missing_prerelease_default_gem_activation) source "#{source_uri}" source "#{source_uri}/extra" do gem "back_deps" diff --git a/spec/bundler/install/gems/native_extensions_spec.rb b/spec/bundler/install/gems/native_extensions_spec.rb index a057d0d152..dba0607bb4 100644 --- a/spec/bundler/install/gems/native_extensions_spec.rb +++ b/spec/bundler/install/gems/native_extensions_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "installing a gem with native extensions", :ruby_repo do +RSpec.describe "installing a gem with native extensions" do it "installs" do build_repo2 do build_gem "c_extension" do |s| diff --git a/spec/bundler/install/gems/standalone_spec.rb b/spec/bundler/install/gems/standalone_spec.rb index 521499a5df..2490227e13 100644 --- a/spec/bundler/install/gems/standalone_spec.rb +++ b/spec/bundler/install/gems/standalone_spec.rb @@ -21,7 +21,7 @@ RSpec.shared_examples "bundle install --standalone" do testrb << "\nrequire \"#{k}\"" testrb << "\nputs #{k.upcase}" end - ruby testrb, :no_lib => true + ruby testrb expect(out).to eq(expected_gems.values.join("\n")) end @@ -43,7 +43,7 @@ RSpec.shared_examples "bundle install --standalone" do testrb << "\nrequire \"#{k}\"" testrb << "\nputs #{k.upcase}" end - ruby testrb, :no_lib => true, :dir => "#{bundled_app}2" + ruby testrb, :dir => "#{bundled_app}2" expect(out).to eq(expected_gems.values.join("\n")) end @@ -68,7 +68,7 @@ RSpec.shared_examples "bundle install --standalone" do include_examples "common functionality" end - describe "with gems with native extension", :ruby_repo do + describe "with gems with native extension" do before do install_gemfile <<-G, forgotten_command_line_options(:path => bundled_app("bundle")).merge(:standalone => true, :dir => cwd) source "#{file_uri_for(gem_repo1)}" @@ -165,7 +165,7 @@ RSpec.shared_examples "bundle install --standalone" do it "allows creating a standalone file with limited groups" do bundle! :install, forgotten_command_line_options(:path => bundled_app("bundle")).merge(:standalone => "default", :dir => cwd) - load_error_ruby <<-RUBY, "spec", :no_lib => true + load_error_ruby <<-RUBY, "spec" $:.unshift File.expand_path("bundle") require "bundler/setup" @@ -181,7 +181,7 @@ RSpec.shared_examples "bundle install --standalone" do it "allows --without to limit the groups used in a standalone" do bundle! :install, forgotten_command_line_options(:path => bundled_app("bundle"), :without => "test").merge(:standalone => true, :dir => cwd) - load_error_ruby <<-RUBY, "spec", :no_lib => true + load_error_ruby <<-RUBY, "spec" $:.unshift File.expand_path("bundle") require "bundler/setup" @@ -197,7 +197,7 @@ RSpec.shared_examples "bundle install --standalone" do it "allows --path to change the location of the standalone bundle" do bundle! "install", forgotten_command_line_options(:path => "path/to/bundle").merge(:standalone => true, :dir => cwd) - ruby <<-RUBY, :no_lib => true + ruby <<-RUBY $:.unshift File.expand_path("path/to/bundle") require "bundler/setup" @@ -212,7 +212,7 @@ RSpec.shared_examples "bundle install --standalone" do bundle! :install, forgotten_command_line_options(:without => "test").merge(:dir => cwd) bundle! :install, forgotten_command_line_options(:path => bundled_app("bundle")).merge(:standalone => true, :dir => cwd) - load_error_ruby <<-RUBY, "spec", :no_lib => true + load_error_ruby <<-RUBY, "spec" $:.unshift File.expand_path("bundle") require "bundler/setup" diff --git a/spec/bundler/install/gems/sudo_spec.rb b/spec/bundler/install/gems/sudo_spec.rb index 3e4c1ad1c1..bab8412170 100644 --- a/spec/bundler/install/gems/sudo_spec.rb +++ b/spec/bundler/install/gems/sudo_spec.rb @@ -145,6 +145,8 @@ RSpec.describe "when using sudo", :sudo => true do sudo "mkdir -p #{gem_home}" sudo "chmod ugo-w #{gem_home}" + system_gems :bundler, :path => gem_home + gemfile <<-G source "#{file_uri_for(gem_repo1)}" gem "rack", '1.0' diff --git a/spec/bundler/install/global_cache_spec.rb b/spec/bundler/install/global_cache_spec.rb index de7b511a1d..d93e158ed5 100644 --- a/spec/bundler/install/global_cache_spec.rb +++ b/spec/bundler/install/global_cache_spec.rb @@ -44,7 +44,7 @@ RSpec.describe "global gem caching" do gem "rack" G - FileUtils.rm_r(default_bundle_path) + simulate_new_machine expect(the_bundle).not_to include_gems "rack 1.0.0" expect(source_global_cache("rack-1.0.0.gem")).to exist # rack 1.0.0 is not installed and it is in the global cache @@ -54,7 +54,7 @@ RSpec.describe "global gem caching" do gem "rack", "0.9.1" G - FileUtils.rm_r(default_bundle_path) + simulate_new_machine expect(the_bundle).not_to include_gems "rack 0.9.1" expect(source2_global_cache("rack-0.9.1.gem")).to exist # rack 0.9.1 is not installed and it is in the global cache @@ -68,7 +68,7 @@ RSpec.describe "global gem caching" do # rack 1.0.0 is installed and rack 0.9.1 is not expect(the_bundle).to include_gems "rack 1.0.0" expect(the_bundle).not_to include_gems "rack 0.9.1" - FileUtils.rm_r(default_bundle_path) + simulate_new_machine gemfile <<-G source "#{source2}" @@ -88,7 +88,7 @@ RSpec.describe "global gem caching" do G bundle! :install, :artifice => "compact_index" - FileUtils.rm_r(default_bundle_path) + simulate_new_machine expect(the_bundle).not_to include_gems "rack 1.0.0" expect(source_global_cache("rack-1.0.0.gem")).to exist # rack 1.0.0 is not installed and it is in the global cache @@ -99,7 +99,7 @@ RSpec.describe "global gem caching" do G bundle! :install, :artifice => "compact_index" - FileUtils.rm_r(default_bundle_path) + simulate_new_machine expect(the_bundle).not_to include_gems "rack 0.9.1" expect(source2_global_cache("rack-0.9.1.gem")).to exist # rack 0.9.1 is not installed and it is in the global cache @@ -145,7 +145,7 @@ RSpec.describe "global gem caching" do expect(the_bundle).to include_gems "activesupport 2.3.5" expect(source_global_cache("rack-1.0.0.gem")).to exist expect(source_global_cache("activesupport-2.3.5.gem")).to exist - FileUtils.rm_r(default_bundle_path) + simulate_new_machine # Both gems are now only in the global cache expect(the_bundle).not_to include_gems "rack 1.0.0" expect(the_bundle).not_to include_gems "activesupport 2.3.5" @@ -185,7 +185,7 @@ RSpec.describe "global gem caching" do end end - describe "extension caching", :ruby_repo do + describe "extension caching" do it "works" do skip "gets incorrect ref in path" if Gem.win_platform? diff --git a/spec/bundler/install/path_spec.rb b/spec/bundler/install/path_spec.rb index bed28ed3e2..3176258565 100644 --- a/spec/bundler/install/path_spec.rb +++ b/spec/bundler/install/path_spec.rb @@ -162,7 +162,7 @@ RSpec.describe "bundle install" do expect(the_bundle).to include_gems "rack 1.0.0" end - it "re-installs gems whose extensions have been deleted", :ruby_repo do + it "re-installs gems whose extensions have been deleted" do build_lib "very_simple_binary", "1.0.0", :to_system => true do |s| s.write "lib/very_simple_binary.rb", "raise 'FAIL'" end |