diff options
Diffstat (limited to 'spec/bundler/install/gemfile/path_spec.rb')
-rw-r--r-- | spec/bundler/install/gemfile/path_spec.rb | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/spec/bundler/install/gemfile/path_spec.rb b/spec/bundler/install/gemfile/path_spec.rb index 54a41b576f..e80764070c 100644 --- a/spec/bundler/install/gemfile/path_spec.rb +++ b/spec/bundler/install/gemfile/path_spec.rb @@ -313,7 +313,7 @@ RSpec.describe "bundle install with explicit source paths" do install_gemfile <<-G gem 'foo', '1.0', :path => "#{lib_path("foo-1.0")}" G - expect(last_command.stderr).to be_empty + expect(err).to be_empty end it "removes the .gem file after installing" do @@ -484,6 +484,68 @@ RSpec.describe "bundle install with explicit source paths" do expect(the_bundle).to include_gems "rack 1.0.0" end + + it "keeps using the same version if it's compatible" 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: #{URI.parse("file://#{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" + end + + bundle "install" + + lockfile_should_be <<-G + PATH + remote: #{lib_path("foo")} + specs: + foo (1.0) + rack + + GEM + remote: #{URI.parse("file://#{gem_repo1}/")} + specs: + rack (0.9.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 |