aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/test_case.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-05 01:00:01 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-05 01:00:01 +0000
commit3434676e9e3c87c39fe4a8c411a041449efc7446 (patch)
tree1dabd9705561ef803bb9f62e6d8e3eaf0618a1cb /lib/rubygems/test_case.rb
parentd24997cce12d27cec767ca7091a076df1b2319db (diff)
downloadruby-3434676e9e3c87c39fe4a8c411a041449efc7446.tar.gz
* lib/rubygems: Import RubyGems 1.8.7:
Added missing require for `gem uninstall --format-executable`. The correct name of the executable being uninstalled is now displayed with --format-executable. Fixed `gem unpack uninstalled_gem` default version picker. RubyGems no longer claims a nonexistent gem can be uninstalled. `gem which` no longer claims directories are requirable files. `gem cleanup` continues cleaning up gems if one can't be uninstalled due to permissions. Issue #82. Gem repository directories are no longer created world-writable. Patch by Sakuro OZAWA. [Ruby 1.9 - Bug #4930] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/test_case.rb')
-rw-r--r--lib/rubygems/test_case.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index 6ab5095267..6aed3487c6 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -258,6 +258,25 @@ class Gem::TestCase < MiniTest::Unit::TestCase
end
##
+ # Builds and installs the Gem::Specification +spec+ into the user dir
+
+ def install_gem_user spec
+ require 'rubygems/installer'
+
+ use_ui Gem::MockGemUi.new do
+ Dir.chdir @tempdir do
+ Gem::Builder.new(spec).build
+ end
+ end
+
+ gem = File.join(@tempdir, File.basename(spec.cache_file)).untaint
+
+ i = Gem::Installer.new(gem, :wrappers => true, :user_install => true)
+ i.install
+ i.spec
+ end
+
+ ##
# Uninstalls the Gem::Specification +spec+
def uninstall_gem spec
require 'rubygems/uninstaller'
@@ -678,12 +697,13 @@ Also, a list:
end
v = Gem.marshal_version
+
Gem::Specification.each do |spec|
path = "#{@gem_repo}quick/Marshal.#{v}/#{spec.original_name}.gemspec.rz"
data = Marshal.dump spec
data_deflate = Zlib::Deflate.deflate data
@fetcher.data[path] = data_deflate
- end
+ end unless Gem::RemoteFetcher === @fetcher # HACK for test_download_to_cache
nil # force errors
end