summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-07-21 12:38:35 -0700
committerCarlhuda <carlhuda@engineyard.com>2010-07-21 12:38:35 -0700
commit424e233b9849d7ebf074e2405e3ad3dc180d7147 (patch)
tree5f1fc9aa09895699f92fe54961ba4e2b7008dd58
parent362eb5068d00319eff6a11c335d098ab78be3141 (diff)
downloadbundler-424e233b9849d7ebf074e2405e3ad3dc180d7147.tar.gz
Fixes bug involving switching from path to git source
-rw-r--r--lib/bundler/source.rb2
-rw-r--r--spec/install/git_spec.rb24
2 files changed, 25 insertions, 1 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index 925e64aca3..dc63197a1c 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -305,7 +305,7 @@ module Bundler
end
def eql?(o)
- Path === o &&
+ o.instance_of?(Path) &&
path == o.path &&
name == o.name &&
version == o.version
diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb
index e02a2ad44e..fbfe532e1e 100644
--- a/spec/install/git_spec.rb
+++ b/spec/install/git_spec.rb
@@ -410,4 +410,28 @@ describe "bundle install with git sources" do
bundle "install", :exit_status => true
exitstatus.should == 0
end
+
+ describe "switching sources" do
+ it "doesn't explode when switching Path to Git sources" do
+ build_gem "foo", "1.0", :to_system => true do |s|
+ s.write "lib/foo.rb", "raise 'fail'"
+ end
+ build_lib "foo", "1.0", :path => lib_path('bar/foo')
+ build_git "bar", "1.0", :path => lib_path('bar') do |s|
+ s.add_dependency 'foo'
+ end
+
+ install_gemfile <<-G
+ source "http://#{gem_repo1}"
+ gem "bar", :path => "#{lib_path('bar')}"
+ G
+
+ install_gemfile <<-G
+ source "http://#{gem_repo1}"
+ gem "bar", :git => "#{lib_path('bar')}"
+ G
+
+ should_be_installed "foo 1.0", "bar 1.0"
+ end
+ end
end