diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-04-18 00:04:12 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-04-18 00:04:12 +0000 |
commit | 6c1da63bd77b4caa409b919f8c9893b27f9ae1be (patch) | |
tree | aa2133f45cc00ba879f1309a0a890b15d10dd4c2 /lib/rubygems/test_case.rb | |
parent | 5ab11990cb24bc31c400b21a07b10c48d0b0d5d1 (diff) | |
download | ruby-6c1da63bd77b4caa409b919f8c9893b27f9ae1be.tar.gz |
* lib/rubygems: Update to RubyGems 1.8.22 plus r33517 and r35337 which
were ported to the rubygems git repository.
See https://github.com/rubygems/rubygems/blob/1.8/History.txt for
changes since 1.8.11.
* test/rubygems: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/test_case.rb')
-rw-r--r-- | lib/rubygems/test_case.rb | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index 6aed3487c6..9fbdfca52e 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 + def install_gem spec, options = {} require 'rubygems/installer' use_ui Gem::MockGemUi.new do @@ -254,26 +254,14 @@ class Gem::TestCase < MiniTest::Unit::TestCase gem = File.join(@tempdir, File.basename(spec.cache_file)).untaint - Gem::Installer.new(gem, :wrappers => true).install + Gem::Installer.new(gem, options.merge({:wrappers => true})).install 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 + install_gem spec, :user_install => true end ## @@ -499,8 +487,11 @@ class Gem::TestCase < MiniTest::Unit::TestCase if deps then block = proc do |s| - deps.each do |n, req| - s.add_dependency n, (req || '>= 0') + # 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') end end end @@ -520,8 +511,11 @@ class Gem::TestCase < MiniTest::Unit::TestCase if deps then block = proc do |s| - deps.each do |n, req| - s.add_dependency n, (req || '>= 0') + # 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') end end end @@ -874,4 +868,3 @@ Also, a list: end end - |