aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/test_utilities.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-08 01:22:39 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-08 01:22:39 +0000
commit7ed9b794b4e3f3f9874f2ce19401461596d8a2c0 (patch)
tree5caaf13685de34b09d2949709a77b4c650b62741 /lib/rubygems/test_utilities.rb
parent866b438c21ff05dfeabba8bc9aa9850e415be607 (diff)
downloadruby-7ed9b794b4e3f3f9874f2ce19401461596d8a2c0.tar.gz
* lib/rubygems: Update to RubyGems master 14749ce. This fixes bugs
handling of gem dependencies lockfiles (Gemfile.lock). * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/test_utilities.rb')
-rw-r--r--lib/rubygems/test_utilities.rb27
1 files changed, 19 insertions, 8 deletions
diff --git a/lib/rubygems/test_utilities.rb b/lib/rubygems/test_utilities.rb
index ee5ef01203..3deb71fa46 100644
--- a/lib/rubygems/test_utilities.rb
+++ b/lib/rubygems/test_utilities.rb
@@ -199,16 +199,17 @@ class Gem::TestCase::SpecFetcherSetup
# Executes a SpecFetcher setup block. Yields an instance then creates the
# gems and specifications defined in the instance.
- def self.declare test
- setup = new test
+ def self.declare test, repository
+ setup = new test, repository
yield setup
setup.execute
end
- def initialize test # :nodoc:
- @test = test
+ def initialize test, repository # :nodoc:
+ @test = test
+ @repository = repository
@gems = {}
@installed = []
@@ -298,12 +299,22 @@ class Gem::TestCase::SpecFetcherSetup
require 'socket'
require 'rubygems/remote_fetcher'
- @test.fetcher = Gem::FakeFetcher.new
- Gem::RemoteFetcher.fetcher = @test.fetcher
+ unless @test.fetcher then
+ @test.fetcher = Gem::FakeFetcher.new
+ Gem::RemoteFetcher.fetcher = @test.fetcher
+ end
Gem::Specification.reset
- @test.util_setup_spec_fetcher(*@gems.keys)
+ begin
+ gem_repo, @test.gem_repo = @test.gem_repo, @repository
+ @test.uri = URI @repository
+
+ @test.util_setup_spec_fetcher(*@gems.keys)
+ ensure
+ @test.gem_repo = gem_repo
+ @test.uri = URI gem_repo
+ end
# This works around util_setup_spec_fetcher adding all created gems to the
# installed set.
@@ -313,7 +324,7 @@ class Gem::TestCase::SpecFetcherSetup
@gems.each do |spec, gem|
next unless gem
- @test.fetcher.data["http://gems.example.com/gems/#{spec.file_name}"] =
+ @test.fetcher.data["#{@repository}gems/#{spec.file_name}"] =
Gem.read_binary(gem)
FileUtils.cp gem, spec.cache_file