summaryrefslogtreecommitdiff
path: root/test/rubygems/gemutilities.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/gemutilities.rb')
-rw-r--r--test/rubygems/gemutilities.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/rubygems/gemutilities.rb b/test/rubygems/gemutilities.rb
index f12f4e88a5..967e3dc34d 100644
--- a/test/rubygems/gemutilities.rb
+++ b/test/rubygems/gemutilities.rb
@@ -61,6 +61,8 @@ class FakeFetcher
name = "#{spec.full_name}.gem"
path = File.join(install_dir, 'cache', name)
+ Gem.ensure_gem_subdirectories install_dir
+
if source_uri =~ /^http/ then
File.open(path, "wb") do |f|
f.write fetch_path(File.join(source_uri, "gems", name))
@@ -369,6 +371,17 @@ class RubyGemTestCase < Test::Unit::TestCase
Gem.win_platform?
end
+ # NOTE Allow tests to use a random (but controlled) port number instead of
+ # a hardcoded one. This helps CI tools when running parallels builds on
+ # the same builder slave.
+ def self.process_based_port
+ @@process_based_port ||= 8000 + $$ % 1000
+ end
+
+ def process_based_port
+ self.class.process_based_port
+ end
+
end
class TempIO