From 0e40cc9b194a5e46024d32b85a61e651372a65cb Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 18 Dec 2020 12:13:33 +0900 Subject: Merge RubyGems 3.2.2 and Bundler 2.2.2 --- spec/bundler/commands/console_spec.rb | 8 ++--- spec/bundler/commands/lock_spec.rb | 41 ++++++++++++++++++++++ spec/bundler/install/gemfile/groups_spec.rb | 20 +++++++++-- .../realworld/fixtures/warbler/Gemfile.lock | 2 +- 4 files changed, 64 insertions(+), 7 deletions(-) (limited to 'spec') diff --git a/spec/bundler/commands/console_spec.rb b/spec/bundler/commands/console_spec.rb index 6f1e96261e..aa76096e3d 100644 --- a/spec/bundler/commands/console_spec.rb +++ b/spec/bundler/commands/console_spec.rb @@ -55,10 +55,10 @@ RSpec.describe "bundle console", :bundler => "< 3", :readline => true do it "uses IRB as default console" do bundle "console" do |input, _, _| - input.puts("__method__") + input.puts("__FILE__") input.puts("exit") end - expect(out).to include(":irb_binding") + expect(out).to include("(irb)") end it "starts another REPL if configured as such" do @@ -80,10 +80,10 @@ RSpec.describe "bundle console", :bundler => "< 3", :readline => true do # make sure pry isn't there bundle "console" do |input, _, _| - input.puts("__method__") + input.puts("__FILE__") input.puts("exit") end - expect(out).to include(":irb_binding") + expect(out).to include("(irb)") end it "doesn't load any other groups" do diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb index cc56c34952..6400152039 100644 --- a/spec/bundler/commands/lock_spec.rb +++ b/spec/bundler/commands/lock_spec.rb @@ -342,6 +342,47 @@ RSpec.describe "bundle lock" do G end + it "doesn't crash when an update candidate doesn't have any matching platform" do + build_repo4 do + build_gem "libv8", "8.4.255.0" + build_gem "libv8", "8.4.255.0" do |s| + s.platform = "x86_64-darwin-19" + end + + build_gem "libv8", "15.0.71.48.1beta2" do |s| + s.platform = "x86_64-linux" + end + end + + gemfile <<-G + source "#{file_uri_for(gem_repo4)}" + + gem "libv8" + G + + lockfile <<-G + GEM + remote: #{file_uri_for(gem_repo4)}/ + specs: + libv8 (8.4.255.0) + libv8 (8.4.255.0-x86_64-darwin-19) + + PLATFORMS + ruby + x86_64-darwin-19 + + DEPENDENCIES + libv8 + + BUNDLED WITH + #{Bundler::VERSION} + G + + simulate_platform(Gem::Platform.new("x86_64-darwin-19")) { bundle "lock --update" } + + expect(out).to match(/Writing lockfile to.+Gemfile\.lock/) + end + context "when an update is available" do let(:repo) { gem_repo2 } diff --git a/spec/bundler/install/gemfile/groups_spec.rb b/spec/bundler/install/gemfile/groups_spec.rb index 4e7484ddbd..567a9b1172 100644 --- a/spec/bundler/install/gemfile/groups_spec.rb +++ b/spec/bundler/install/gemfile/groups_spec.rb @@ -91,8 +91,17 @@ RSpec.describe "bundle install with groups" do expect(the_bundle).to include_gems "rack 1.0.0", :groups => [:default] end - it "respects global `without` configuration, but does not save it locally" do - bundle "config without emo" + it "respects global `without` configuration, and saves it locally", :bundler => "< 3" do + bundle "config set without emo" + bundle :install + expect(the_bundle).to include_gems "rack 1.0.0", :groups => [:default] + bundle "config list" + expect(out).to include("Set for your local app (#{bundled_app(".bundle/config")}): [:emo]") + expect(out).to include("Set for the current user (#{home(".bundle/config")}): [:emo]") + end + + it "respects global `without` configuration, but does not save it locally", :bundler => "3" do + bundle "config set without emo" bundle :install expect(the_bundle).to include_gems "rack 1.0.0", :groups => [:default] bundle "config list" @@ -100,6 +109,13 @@ RSpec.describe "bundle install with groups" do expect(out).to include("Set for the current user (#{home(".bundle/config")}): [:emo]") end + it "allows running application where groups where configured by a different user", :bundler => "< 3" do + bundle "config set without emo" + bundle :install + bundle "exec ruby -e 'puts 42'", :env => { "BUNDLE_USER_HOME" => tmp("new_home").to_s } + expect(out).to include("42") + end + it "does not install gems from the excluded group" do bundle "config --local without emo" bundle :install diff --git a/spec/bundler/realworld/fixtures/warbler/Gemfile.lock b/spec/bundler/realworld/fixtures/warbler/Gemfile.lock index bcf0799494..6945be3ed2 100644 --- a/spec/bundler/realworld/fixtures/warbler/Gemfile.lock +++ b/spec/bundler/realworld/fixtures/warbler/Gemfile.lock @@ -6,7 +6,7 @@ PATH GEM remote: https://rubygems.org/ specs: - jruby-jars (9.2.11.1) + jruby-jars (9.2.14.0) jruby-rack (1.1.21) rake (13.0.1) rubyzip (1.3.0) -- cgit v1.2.3