summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-02-18 16:46:06 +0000
committerThe Bundler Bot <bot@bundler.io>2017-02-18 16:46:06 +0000
commit42215fe7279bd90d48f2d4e09227d327e007b5bc (patch)
tree0011a9f2ea7a395e33d2cb7e33aa0a615cedc327 /spec/support
parentcc4414ca7cfe76989ecbefec8408e2c26cdaf71d (diff)
parentfe0fdb108b9a72889383b99d98dd8e58ae75a557 (diff)
downloadbundler-42215fe7279bd90d48f2d4e09227d327e007b5bc.tar.gz
Auto merge of #5427 - bundler:seg-api-missing-dependencies, r=indirect
Fail gracefully when installing a spec where the API is missing deps Fixes https://github.com/bundler/bundler/issues/5426 Closes https://github.com/bundler/bundler/issues/5339
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/artifice/compact_index_wrong_dependencies.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/support/artifice/compact_index_wrong_dependencies.rb b/spec/support/artifice/compact_index_wrong_dependencies.rb
new file mode 100644
index 0000000000..25935f5e5d
--- /dev/null
+++ b/spec/support/artifice/compact_index_wrong_dependencies.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+require File.expand_path("../compact_index", __FILE__)
+
+Artifice.deactivate
+
+class CompactIndexWrongDependencies < CompactIndexAPI
+ get "/info/:name" do
+ etag_response do
+ gem = gems.find {|g| g.name == params[:name] }
+ gem.versions.each {|gv| gv.dependencies.clear } if gem
+ CompactIndex.info(gem ? gem.versions : [])
+ end
+ end
+end
+
+Artifice.activate_with(CompactIndexWrongDependencies)