Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Auto merge of #4928 - bundler:seg-update-compact-index, r=segiddins
Browse files Browse the repository at this point in the history
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
  • Loading branch information
homu authored and segiddins committed Aug 29, 2016
1 parent aebe284 commit 20cbbf0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions spec/support/artifice/compact_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def gems(gem_repo = gem_repo1)
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

Expand Down
4 changes: 2 additions & 2 deletions spec/support/artifice/compact_index_extra_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 11 additions & 6 deletions spec/support/rubygems_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module Rubygems
# 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",
Expand All @@ -35,7 +36,7 @@ def self.setup
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

Expand All @@ -44,10 +45,14 @@ def self.setup
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 = {})
Expand Down

0 comments on commit 20cbbf0

Please sign in to comment.