summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomu <homu@barosl.com>2016-08-30 05:00:36 +0900
committerSamuel Giddins <segiddins@segiddins.me>2016-08-29 15:17:50 -0500
commit20cbbf0d5d86a30b8afef8906bdf7536b0565367 (patch)
tree0a4e8338a0a581259482e1dc4a44dec3d6f57b37
parentaebe284e3e97406a5636e195a3cb9a57cd6c32ee (diff)
downloadbundler-20cbbf0d5d86a30b8afef8906bdf7536b0565367.tar.gz
Auto merge of #4928 - bundler:seg-update-compact-index, r=segiddins
Update specs to use compact_index 0.11 Also removed the penalty for adding requirements to dependencies! \c @indirect # Conflicts: # spec/support/artifice/compact_index_concurrent_download.rb
-rw-r--r--spec/support/artifice/compact_index.rb4
-rw-r--r--spec/support/artifice/compact_index_extra_api.rb4
-rw-r--r--spec/support/rubygems_ext.rb17
3 files changed, 15 insertions, 10 deletions
diff --git a/spec/support/artifice/compact_index.rb b/spec/support/artifice/compact_index.rb
index 88706c3590..458c81b4b1 100644
--- a/spec/support/artifice/compact_index.rb
+++ b/spec/support/artifice/compact_index.rb
@@ -90,8 +90,8 @@ class CompactIndexAPI < Endpoint
file = tmp("versions.list")
file.delete if file.file?
file = CompactIndex::VersionsFile.new(file.to_s)
- file.update_with(gems)
- CompactIndex.versions(file, nil, {})
+ file.create(gems)
+ file.contents
end
end
diff --git a/spec/support/artifice/compact_index_extra_api.rb b/spec/support/artifice/compact_index_extra_api.rb
index 063e5589d4..844a9ca9f2 100644
--- a/spec/support/artifice/compact_index_extra_api.rb
+++ b/spec/support/artifice/compact_index_extra_api.rb
@@ -15,8 +15,8 @@ class CompactIndexExtraApi < CompactIndexAPI
file = tmp("versions.list")
file.delete if file.file?
file = CompactIndex::VersionsFile.new(file.to_s)
- file.update_with(gems(gem_repo4))
- CompactIndex.versions(file, nil, {})
+ file.create(gems(gem_repo4))
+ file.contents
end
end
diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb
index 85ed1bdf0f..dda77ec712 100644
--- a/spec/support/rubygems_ext.rb
+++ b/spec/support/rubygems_ext.rb
@@ -9,7 +9,8 @@ module Spec
# rack 2.x requires Ruby version >= 2.2.2.
# artifice doesn't support rack 2.x now.
"rack" => "< 2",
- "fakeweb artifice compact_index" => nil,
+ "fakeweb artifice" => nil,
+ "compact_index" => "~> 0.11.0",
"sinatra" => "1.2.7",
# Rake version has to be consistent for tests to pass
"rake" => "10.0.2",
@@ -35,7 +36,7 @@ module Spec
FileUtils.rm_rf(Path.base_system_gems)
FileUtils.mkdir_p(Path.base_system_gems)
puts "installing gems for the tests to use..."
- DEPS.sort {|a, _| a[1].nil? ? 1 : -1 }.each {|n, v| install_gem(n, v) }
+ install_gems(DEPS)
File.open(manifest_path, "w") {|f| f << manifest.join }
end
@@ -44,10 +45,14 @@ module Spec
Gem::DefaultUserInteraction.ui = Gem::SilentUI.new
end
- def self.install_gem(name, version = nil)
- cmd = "gem install #{name} --no-rdoc --no-ri"
- cmd += " --version '#{version}'" if version
- system(cmd) || raise("Installing gem #{name} for the tests to use failed!")
+ def self.install_gems(gems)
+ reqs, no_reqs = gems.partition {|_, req| !req.nil? && !req.split(" ").empty? }
+ no_reqs.map!(&:first)
+ reqs.map! {|name, req| "'#{name}:#{req}'" }
+ deps = reqs.concat(no_reqs).join(" ")
+ cmd = "gem install #{deps} --no-rdoc --no-ri"
+ puts cmd
+ system(cmd) || raise("Installing gems #{deps} for the tests to use failed!")
end
def gem_command(command, args = "", options = {})