summaryrefslogtreecommitdiff
path: root/lib/rubygems/test_utilities.rb
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-01 09:41:32 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-01 09:41:32 +0000
commit25a9b62d45ddd60a231272567c7dda9337da9b62 (patch)
treee72ba4c9c01cba5fb510eb1eafaba76d998baf4c /lib/rubygems/test_utilities.rb
parent86bb0af7ea3b50f72e6845a6f5f64cb1b23fd279 (diff)
Import rubygems 1.6.0 (released version @ 58d8a0b9)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/test_utilities.rb')
-rw-r--r--lib/rubygems/test_utilities.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/rubygems/test_utilities.rb b/lib/rubygems/test_utilities.rb
index 892e4dd9e5..43f905f017 100644
--- a/lib/rubygems/test_utilities.rb
+++ b/lib/rubygems/test_utilities.rb
@@ -104,7 +104,7 @@ class Gem::FakeFetcher
def download spec, source_uri, install_dir = Gem.dir
name = spec.file_name
- path = File.join(install_dir, 'cache', name)
+ path = Gem.cache_gem(name, install_dir)
Gem.ensure_gem_subdirectories install_dir
@@ -119,6 +119,16 @@ class Gem::FakeFetcher
path
end
+ def download_to_cache dependency
+ found = Gem::SpecFetcher.fetcher.fetch dependency
+
+ return if found.empty?
+
+ spec, source_uri = found.first
+
+ download spec, source_uri
+ end
+
end
# :stopdoc: