summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-02-13 14:03:57 -0600
committerSamuel Giddins <segiddins@segiddins.me>2017-02-13 14:10:19 -0600
commitad5aaa7c9b3a6e09fea980015d9c8666525858a1 (patch)
tree0cd572b1f69866f42f8d3190c8f6cdee22a3b23c
parent659c1f9703fb4a12f36ff0c992eb5fd03c6a1c32 (diff)
downloadbundler-ad5aaa7c9b3a6e09fea980015d9c8666525858a1.tar.gz
When swapping, dont consider dep type for "missing" API deps
-rw-r--r--lib/bundler/endpoint_specification.rb3
-rw-r--r--lib/bundler/remote_specification.rb3
-rw-r--r--spec/bundler/remote_specification_spec.rb4
3 files changed, 6 insertions, 4 deletions
diff --git a/lib/bundler/endpoint_specification.rb b/lib/bundler/endpoint_specification.rb
index e60bed9d03..fbba025779 100644
--- a/lib/bundler/endpoint_specification.rb
+++ b/lib/bundler/endpoint_specification.rb
@@ -91,7 +91,8 @@ module Bundler
end
def __swap__(spec)
- if (extra_deps = spec.runtime_dependencies.-(dependencies)) && extra_deps.any?
+ without_type = proc {|d| Gem::Dependency.new(d.name, d.requirements_list) }
+ if (extra_deps = spec.runtime_dependencies.map(&without_type).-(dependencies.map(&without_type))) && extra_deps.any?
raise APIResponseMismatchError,
"Downloading #{full_name} revealed dependencies not in the API (#{extra_deps.map(&:to_s).join(", ")})." \
"\nInstalling with `--full-index` should fix the problem."
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb
index 496e8dcb3a..c62c5d61d2 100644
--- a/lib/bundler/remote_specification.rb
+++ b/lib/bundler/remote_specification.rb
@@ -50,7 +50,8 @@ module Bundler
# once the remote gem is downloaded, the backend specification will
# be swapped out.
def __swap__(spec)
- if (extra_deps = spec.runtime_dependencies.-(dependencies)) && extra_deps.any?
+ without_type = proc {|d| Gem::Dependency.new(d.name, d.requirements_list) }
+ if (extra_deps = spec.runtime_dependencies.map(&without_type).-(dependencies.map(&without_type))) && extra_deps.any?
raise APIResponseMismatchError,
"Downloading #{full_name} revealed dependencies not in the API (#{extra_deps.map(&:to_s).join(", ")})." \
"\nInstalling with `--full-index` should fix the problem."
diff --git a/spec/bundler/remote_specification_spec.rb b/spec/bundler/remote_specification_spec.rb
index c8832d358e..69a2ab3d67 100644
--- a/spec/bundler/remote_specification_spec.rb
+++ b/spec/bundler/remote_specification_spec.rb
@@ -128,8 +128,8 @@ RSpec.describe Bundler::RemoteSpecification do
end
describe "#__swap__" do
- let(:spec) { double(:spec) }
- let(:new_spec) { double(:new_spec) }
+ let(:spec) { double(:spec, :dependencies => []) }
+ let(:new_spec) { double(:new_spec, :runtime_dependencies => []) }
before { subject.instance_variable_set(:@_remote_specification, spec) }