diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-07-12 14:38:25 -0700 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-07-12 14:38:25 -0700 |
commit | 9f8db4ef1fca1d9f2b526d325e83c3a6e309fc5c (patch) | |
tree | ff51ea5c489f3d166d190789167d52aed9ba9f85 | |
parent | 609668272f4d2f8ba20df51dc45e32494a49ba93 (diff) | |
download | bundler-9f8db4ef1fca1d9f2b526d325e83c3a6e309fc5c.tar.gz |
Fixes a bug where unpinned specs that became pinned did not get unlocked on install
-rw-r--r-- | lib/bundler/definition.rb | 2 | ||||
-rw-r--r-- | spec/install/git_spec.rb | 32 |
2 files changed, 33 insertions, 1 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 429e3ff251..5b85e63e00 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -232,7 +232,7 @@ module Bundler end def satisfies_locked_spec?(dep) - @last_resolve.any? { |s| s.satisfies?(dep) } + @last_resolve.any? { |s| s.satisfies?(dep) && (!dep.source || s.source == dep.source) } end def expanded_dependencies diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb index 0c85cacb12..afa57254f1 100644 --- a/spec/install/git_spec.rb +++ b/spec/install/git_spec.rb @@ -136,6 +136,38 @@ describe "bundle install with git sources" do run "require 'rack'" out.should == 'WIN OVERRIDE' end + + it "correctly unlocks when changing to a git source" do + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "rack", "0.9.1" + G + + build_git "rack", :path => lib_path("rack") + + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "rack", "1.0.0", :git => "#{lib_path('rack')}" + G + + should_be_installed "rack 1.0.0" + end + + it "correctly unlocks when changing to a git source without versions" do + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "rack" + G + + build_git "rack", "1.2", :path => lib_path("rack") + + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "rack", :git => "#{lib_path('rack')}" + G + + should_be_installed "rack 1.2" + end end describe "block syntax" do |