From 679185d6c87e0f2e4f6a5da5ce50d02c80ab31b1 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 2 Aug 2021 12:06:43 +0900 Subject: Merge RubyGems 3.2.24 and Bundler 2.2.24 --- spec/bundler/commands/check_spec.rb | 28 ++++++++++++++++++++++++++++ spec/bundler/commands/install_spec.rb | 1 + spec/bundler/commands/newgem_spec.rb | 10 +++++----- 3 files changed, 34 insertions(+), 5 deletions(-) (limited to 'spec/bundler/commands') diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb index 2860c82a12..88950cef85 100644 --- a/spec/bundler/commands/check_spec.rb +++ b/spec/bundler/commands/check_spec.rb @@ -288,6 +288,34 @@ RSpec.describe "bundle check" do end end + describe "when locked with multiple dependents with different requirements" do + before :each do + build_repo4 do + build_gem "depends_on_rack" do |s| + s.add_dependency "rack", ">= 1.0" + end + build_gem "also_depends_on_rack" do |s| + s.add_dependency "rack", "~> 1.0" + end + build_gem "rack" + end + + gemfile <<-G + source "#{file_uri_for(gem_repo4)}" + gem "depends_on_rack" + gem "also_depends_on_rack" + G + + bundle "lock" + end + + it "shows what is missing with the current Gemfile without duplications" do + bundle :check, :raise_on_error => false + expect(err).to match(/The following gems are missing/) + expect(err).to include("* rack (1.0").once + end + end + describe "when using only scoped rubygems sources" do before do gemfile <<~G diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index 3c0c35d844..00a277a826 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -388,6 +388,7 @@ RSpec.describe "bundle install with gem sources" do bundle :install expect(err).to be_empty + expect(the_bundle).to include_gems("my-private-gem 1.0") end it "throws an error if a gem is added twice in Gemfile when version of one dependency is not specified" do diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb index 57932fb013..5cdb3ed5e3 100644 --- a/spec/bundler/commands/newgem_spec.rb +++ b/spec/bundler/commands/newgem_spec.rb @@ -201,35 +201,35 @@ RSpec.describe "bundle gem" do skip "ruby_core has an 'ast.rb' file that gets in the middle and breaks this spec" if ruby_core? bundle "gem #{gem_name} --rubocop" bundle_exec_rubocop - expect(err).to be_empty + expect(last_command).to be_success end it "has no rubocop offenses when using --ext and --rubocop flag", :readline do skip "ruby_core has an 'ast.rb' file that gets in the middle and breaks this spec" if ruby_core? bundle "gem #{gem_name} --ext --rubocop" bundle_exec_rubocop - expect(err).to be_empty + expect(last_command).to be_success end it "has no rubocop offenses when using --ext, --test=minitest, and --rubocop flag", :readline do skip "ruby_core has an 'ast.rb' file that gets in the middle and breaks this spec" if ruby_core? bundle "gem #{gem_name} --ext --test=minitest --rubocop" bundle_exec_rubocop - expect(err).to be_empty + expect(last_command).to be_success end it "has no rubocop offenses when using --ext, --test=rspec, and --rubocop flag", :readline do skip "ruby_core has an 'ast.rb' file that gets in the middle and breaks this spec" if ruby_core? bundle "gem #{gem_name} --ext --test=rspec --rubocop" bundle_exec_rubocop - expect(err).to be_empty + expect(last_command).to be_success end it "has no rubocop offenses when using --ext, --ext=test-unit, and --rubocop flag", :readline do skip "ruby_core has an 'ast.rb' file that gets in the middle and breaks this spec" if ruby_core? bundle "gem #{gem_name} --ext --test=test-unit --rubocop" bundle_exec_rubocop - expect(err).to be_empty + expect(last_command).to be_success end shared_examples_for "CI config is absent" do -- cgit v1.2.3