aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/test_case.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-17 21:17:56 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-17 21:17:56 +0000
commit0ebe38eedd3b0b0771f57e1d4a85d472a1b6b64f (patch)
tree3fd875633a962ad584d787f536e5ced1697e058e /lib/rubygems/test_case.rb
parent02dc9ae773d458be60f3fa656d5bb50f41a1c9e2 (diff)
downloadruby-0ebe38eedd3b0b0771f57e1d4a85d472a1b6b64f.tar.gz
Revert r35370 due to bad source branch
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/test_case.rb')
-rw-r--r--lib/rubygems/test_case.rb33
1 files changed, 20 insertions, 13 deletions
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index 9fbdfca52e..6aed3487c6 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -243,7 +243,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
##
# Builds and installs the Gem::Specification +spec+
- def install_gem spec, options = {}
+ def install_gem spec
require 'rubygems/installer'
use_ui Gem::MockGemUi.new do
@@ -254,14 +254,26 @@ class Gem::TestCase < MiniTest::Unit::TestCase
gem = File.join(@tempdir, File.basename(spec.cache_file)).untaint
- Gem::Installer.new(gem, options.merge({:wrappers => true})).install
+ Gem::Installer.new(gem, :wrappers => true).install
end
##
# Builds and installs the Gem::Specification +spec+ into the user dir
def install_gem_user spec
- install_gem spec, :user_install => true
+ 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
##
@@ -487,11 +499,8 @@ class Gem::TestCase < MiniTest::Unit::TestCase
if deps then
block = proc do |s|
- # Since Hash#each is unordered in 1.8, sort
- # the keys and iterate that way so the tests are
- # deteriminstic on all implementations.
- deps.keys.sort.each do |n|
- s.add_dependency n, (deps[n] || '>= 0')
+ deps.each do |n, req|
+ s.add_dependency n, (req || '>= 0')
end
end
end
@@ -511,11 +520,8 @@ class Gem::TestCase < MiniTest::Unit::TestCase
if deps then
block = proc do |s|
- # Since Hash#each is unordered in 1.8, sort
- # the keys and iterate that way so the tests are
- # deteriminstic on all implementations.
- deps.keys.sort.each do |n|
- s.add_dependency n, (deps[n] || '>= 0')
+ deps.each do |n, req|
+ s.add_dependency n, (req || '>= 0')
end
end
end
@@ -868,3 +874,4 @@ Also, a list:
end
end
+