Permalink
Browse files

test when hitting FORCE_MODERN_INDEX_LIMIT

  • Loading branch information...
1 parent aa5ff68 commit 32978b04098580ea58b98808abdb1ef3c2194423 @hone hone committed Aug 5, 2011
Showing with 39 additions and 0 deletions.
  1. +24 −0 spec/install/gems/dependency_api_spec.rb
  2. +15 −0 spec/support/artifice/endpoint_extra_missing.rb
@@ -171,4 +171,28 @@
bundle :install, :artifice => "endpoint_extra"
should_be_installed "back_deps 1.0"
end
+
+ it "does not fetch every specs if the index of gems is large when doing back deps" do
+ build_repo2 do
+ build_gem "back_deps" do |s|
+ s.add_dependency "foo"
+ end
+ build_gem "missing"
+ # need to hit the limit
+ 1.upto(Bundler::Source::Rubygems::FORCE_MODERN_INDEX_LIMIT) do |i|
+ build_gem "gem#{i}"
+ end
+
+ FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
+ end
+
+ gemfile <<-G
+ source "#{source_uri}"
+ source "#{source_uri}/extra"
+ gem "back_deps"
+ G
+
+ bundle :install, :artifice => "endpoint_extra_missing"
+ should_be_installed "back_deps 1.0"
+ end
end
@@ -0,0 +1,15 @@
+require File.expand_path("../endpoint_extra", __FILE__)
+
+Artifice.deactivate
+
+class EndpointExtraMissing < EndpointExtra
+ get "/extra/fetch/actual/gem/:id" do
+ if params[:id] == 'missing-1.0.gemspec.rz'
+ halt 404
+ else
+ File.read("#{gem_repo2}/quick/Marshal.4.8/#{params[:id]}")
+ end
+ end
+end
+
+Artifice.activate_with(EndpointExtraMissing)

0 comments on commit 32978b0

Please sign in to comment.