method
setup_fetcher
v2_6_3 -
Show latest stable
- Class:
Gem::TestCase::SpecFetcherSetup
setup_fetcher()public
No documentation available.
# File lib/rubygems/test_utilities.rb, line 291
def setup_fetcher # :nodoc:
require 'zlib'
require 'socket'
require 'rubygems/remote_fetcher'
unless @test.fetcher
@test.fetcher = Gem::FakeFetcher.new
Gem::RemoteFetcher.fetcher = @test.fetcher
end
Gem::Specification.reset
begin
gem_repo, @test.gem_repo = @test.gem_repo, @repository
@test.uri = URI @repository
@test.util_setup_spec_fetcher(*@downloaded)
ensure
@test.gem_repo = gem_repo
@test.uri = URI gem_repo
end
@gems.each do |spec, gem|
next unless gem
@test.fetcher.data["#{@repository}gems/#{spec.file_name}"] =
Gem.read_binary(gem)
FileUtils.cp gem, spec.cache_file
end
end