summaryrefslogtreecommitdiff
path: root/spec/bundler/install/gemfile
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-01-21 14:35:56 +0900
committerGitHub <noreply@github.com>2021-01-21 14:35:56 +0900
commit151e469a6259837246d88b3abbb4d9e46ff38b9d (patch)
treec071c3e89e5d9ce493f754ce0536499373eab286 /spec/bundler/install/gemfile
parent41d0c708122d0f6389410d503b7f4e6342bf56a0 (diff)
Merge RubyGems 3.2.6 and Bundler 2.2.6 (#4103)
Diffstat (limited to 'spec/bundler/install/gemfile')
-rw-r--r--spec/bundler/install/gemfile/path_spec.rb65
1 files changed, 65 insertions, 0 deletions
diff --git a/spec/bundler/install/gemfile/path_spec.rb b/spec/bundler/install/gemfile/path_spec.rb
index f19fe39721..6cd981e3d3 100644
--- a/spec/bundler/install/gemfile/path_spec.rb
+++ b/spec/bundler/install/gemfile/path_spec.rb
@@ -581,6 +581,71 @@ RSpec.describe "bundle install with explicit source paths" do
expect(the_bundle).to include_gems "rack 0.9.1"
end
+
+ it "keeps using the same version even when another dependency is added" do
+ build_lib "foo", "1.0", :path => lib_path("foo") do |s|
+ s.add_dependency "rack", "0.9.1"
+ end
+
+ bundle "install"
+
+ expect(the_bundle).to include_gems "rack 0.9.1"
+
+ lockfile_should_be <<-G
+ PATH
+ remote: #{lib_path("foo")}
+ specs:
+ foo (1.0)
+ rack (= 0.9.1)
+
+ GEM
+ remote: #{file_uri_for(gem_repo1)}/
+ specs:
+ rack (0.9.1)
+
+ PLATFORMS
+ #{lockfile_platforms}
+
+ DEPENDENCIES
+ foo!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+
+ build_lib "foo", "1.0", :path => lib_path("foo") do |s|
+ s.add_dependency "rack"
+ s.add_dependency "rake", "13.0.1"
+ end
+
+ bundle "install"
+
+ lockfile_should_be <<-G
+ PATH
+ remote: #{lib_path("foo")}
+ specs:
+ foo (1.0)
+ rack
+ rake (= 13.0.1)
+
+ GEM
+ remote: #{file_uri_for(gem_repo1)}/
+ specs:
+ rack (0.9.1)
+ rake (13.0.1)
+
+ PLATFORMS
+ #{lockfile_platforms}
+
+ DEPENDENCIES
+ foo!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+
+ expect(the_bundle).to include_gems "rack 0.9.1"
+ end
end
describe "switching sources" do