summaryrefslogtreecommitdiff
path: root/spec/bundler/commands
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-08-02 12:06:43 +0900
committernagachika <nagachika@ruby-lang.org>2021-08-19 15:46:40 +0900
commit679185d6c87e0f2e4f6a5da5ce50d02c80ab31b1 (patch)
tree293fa8c1f863aeb2f711310dc4941528fa829401 /spec/bundler/commands
parentf1039afa4179f9d3a42f0d89b499e3c955b495d9 (diff)
Merge RubyGems 3.2.24 and Bundler 2.2.24
Diffstat (limited to 'spec/bundler/commands')
-rw-r--r--spec/bundler/commands/check_spec.rb28
-rw-r--r--spec/bundler/commands/install_spec.rb1
-rw-r--r--spec/bundler/commands/newgem_spec.rb10
3 files changed, 34 insertions, 5 deletions
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