From 0527f485ba9c824f7ac4a91bff191c016c2425d4 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Sat, 12 Feb 2011 17:45:27 -0800 Subject: [PATCH] Don't compare Path sources by the unexpanded directory name --- lib/bundler/source.rb | 1 - spec/install/path_spec.rb | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index b374fdd89ed..d83ee148a37 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -317,7 +317,6 @@ def hash def eql?(o) o.instance_of?(Path) && path.expand_path(Bundler.root) == o.path.expand_path(Bundler.root) && - name == o.name && version == o.version end diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb index 3f2bde8e818..a8124217aa3 100644 --- a/spec/install/path_spec.rb +++ b/spec/install/path_spec.rb @@ -141,6 +141,26 @@ should_be_installed "rack 1.0" end + it "doesn't automatically unlock dependencies when using the gemspec syntax" do + build_lib "foo", "1.0", :path => lib_path("foo") do |s| + s.add_dependency "rack", ">= 1.0" + end + + Dir.chdir lib_path("foo") + + install_gemfile lib_path("foo/Gemfile"), <<-G + source "file://#{gem_repo1}" + gemspec + G + + build_gem "rack", "1.0.1", :to_system => true + + bundle "install" + + should_be_installed "foo 1.0" + should_be_installed "rack 1.0" + end + it "raises if there are multiple gemspecs" do build_lib "foo", "1.0", :path => lib_path("foo") do |s| s.write "bar.gemspec"