diff options
author | André Arko <mail@arko.net> | 2014-12-11 22:23:54 -0800 |
---|---|---|
committer | André Arko <mail@arko.net> | 2014-12-11 22:23:54 -0800 |
commit | 79ee7ba50380c1cf374e47131273cb9b9cb17caa (patch) | |
tree | 3e226090dc5d073c8083131b8e1844acdac99fd9 | |
parent | a5ad4e650d977d8881f95cf026ce7b8fe6ff2238 (diff) | |
parent | 5351e8f3993e27d2994b4a50ae429766c0a2df51 (diff) | |
download | bundler-79ee7ba50380c1cf374e47131273cb9b9cb17caa.tar.gz |
Merge pull request #3301 from TimMoore/issue-3298-unlocked-sources
Convert sources to lock format before comparing.
-rw-r--r-- | lib/bundler/source_list.rb | 4 | ||||
-rw-r--r-- | spec/install/gems/sources_spec.rb | 32 |
2 files changed, 34 insertions, 2 deletions
diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb index 05e2251fec..49a976ba6a 100644 --- a/lib/bundler/source_list.rb +++ b/lib/bundler/source_list.rb @@ -59,10 +59,10 @@ module Bundler replacement_rubygems = replacement_sources.detect { |s| s.is_a?(Source::Rubygems) } - @rubygems_aggregate = replacement_rubygems + @rubygems_aggregate = replacement_rubygems if replacement_rubygems # Return true if there were changes - all_sources.to_set != replacement_sources.to_set || + lock_sources.to_set != replacement_sources.to_set || rubygems_remotes.to_set != replacement_rubygems.remotes.to_set end diff --git a/spec/install/gems/sources_spec.rb b/spec/install/gems/sources_spec.rb index e3ab84c0aa..376b105579 100644 --- a/spec/install/gems/sources_spec.rb +++ b/spec/install/gems/sources_spec.rb @@ -239,6 +239,38 @@ describe "bundle install with gems on multiple sources" do expect(out).to include("Could not find gem 'not_in_repo1 (>= 0) ruby'") end end + + context "with an existing lockfile" do + before do + system_gems "rack-0.9.1", "rack-1.0.0" + + lockfile <<-L + GEM + remote: file:#{gem_repo1} + remote: file:#{gem_repo3} + specs: + rack (0.9.1) + + PLATFORMS + ruby + + DEPENDENCIES + rack! + L + + gemfile <<-G + source "file://#{gem_repo1}" + source "file://#{gem_repo3}" do + gem 'rack' + end + G + end + + # Reproduction of https://github.com/bundler/bundler/issues/3298 + it "does not unlock the installed gem on exec" do + should_be_installed("rack 0.9.1") + end + end end context "when an older version of the same gem also ships with Ruby" do |