summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2015-10-16 22:59:11 -0500
committerSamuel Giddins <segiddins@segiddins.me>2015-10-16 23:01:33 -0500
commit9dc6f5bf87589df2f26ac8ff625848aac829a12a (patch)
treefe02b8ed55155f126d0517eca3a91ef50971dd60
parent73576e1c0db09f056f6569b14301c633cc79c815 (diff)
downloadbundler-seg-dir-no-gemspec.tar.gz
[Index] Handle when comparing against an index with no gemspecseg-dir-no-gemspec
-rw-r--r--lib/bundler/index.rb2
-rw-r--r--spec/install/gemfile/path_spec.rb18
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
index d3753f0c66..f71849a87c 100644
--- a/lib/bundler/index.rb
+++ b/lib/bundler/index.rb
@@ -133,7 +133,7 @@ module Bundler
def ==(other)
all? do |spec|
other_spec = other[spec].first
- (spec.dependencies & other_spec.dependencies).empty? && spec.source == other_spec.source
+ other_spec && (spec.dependencies & other_spec.dependencies).empty? && spec.source == other_spec.source
end
end
diff --git a/spec/install/gemfile/path_spec.rb b/spec/install/gemfile/path_spec.rb
index 74f068116e..86179350d9 100644
--- a/spec/install/gemfile/path_spec.rb
+++ b/spec/install/gemfile/path_spec.rb
@@ -341,6 +341,24 @@ describe "bundle install with explicit source paths" do
should_be_installed "foo 1.0"
end
+ it "works when the path does not have a gemspec but there is a lockfile" do
+ lockfile <<-L
+ PATH
+ remote: vendor/bar
+ specs:
+
+ GEM
+ remote: http://rubygems.org
+ L
+
+ in_app_root { FileUtils.mkdir_p("vendor/bar") }
+
+ install_gemfile <<-G
+ gem "bar", "1.0.0", path: "vendor/bar", require: "bar/nyard"
+ G
+ expect(exitstatus).to eq(0) if exitstatus
+ end
+
it "installs executable stubs" do
build_lib "foo" do |s|
s.executables = ["foo"]