aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/gemutilities.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-25 10:13:50 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-25 10:13:50 +0000
commitd478c7a7342478847cc1148f4134b5f0db04e1d9 (patch)
tree3bfca425683a94d1360ecdf5857d741b8eaac213 /test/rubygems/gemutilities.rb
parent788001a9c8473130bd357846785838045387b060 (diff)
downloadruby-d478c7a7342478847cc1148f4134b5f0db04e1d9.tar.gz
Update to RubyGems 1.3.0 r1891
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/gemutilities.rb')
-rw-r--r--test/rubygems/gemutilities.rb37
1 files changed, 35 insertions, 2 deletions
diff --git a/test/rubygems/gemutilities.rb b/test/rubygems/gemutilities.rb
index 0ab2c5272c..d1e50676d5 100644
--- a/test/rubygems/gemutilities.rb
+++ b/test/rubygems/gemutilities.rb
@@ -19,6 +19,10 @@ require 'rubygems/test_utilities'
require File.join(File.expand_path(File.dirname(__FILE__)), 'mockgemui')
module Gem
+ def self.searcher=(searcher)
+ MUTEX.synchronize do @searcher = searcher end
+ end
+
def self.source_index=(si)
@@source_index = si
end
@@ -26,7 +30,7 @@ module Gem
def self.win_platform=(val)
@@win_platform = val
end
-
+
module DefaultUserInteraction
@ui = MockGemUi.new
end
@@ -89,6 +93,27 @@ class RubyGemTestCase < Test::Unit::TestCase
'private_key.pem')
@public_cert = File.expand_path File.join(File.dirname(__FILE__),
'public_cert.pem')
+
+ Gem.post_install_hooks.clear
+ Gem.post_uninstall_hooks.clear
+ Gem.pre_install_hooks.clear
+ Gem.pre_uninstall_hooks.clear
+
+ Gem.post_install do |installer|
+ @post_install_hook_arg = installer
+ end
+
+ Gem.post_uninstall do |uninstaller|
+ @post_uninstall_hook_arg = uninstaller
+ end
+
+ Gem.pre_install do |installer|
+ @pre_install_hook_arg = installer
+ end
+
+ Gem.pre_uninstall do |uninstaller|
+ @pre_uninstall_hook_arg = uninstaller
+ end
end
def teardown
@@ -435,7 +460,15 @@ class RubyGemTestCase < Test::Unit::TestCase
end
@@ruby = rubybin
- @@rake = ENV["rake"] || (@@ruby + " " + File.expand_path("../../../bin/rake", __FILE__))
+ env_rake = ENV['rake']
+ ruby19_rake = @@ruby + " " + File.expand_path("../../../bin/rake", __FILE__)
+ @@rake = if env_rake then
+ ENV["rake"]
+ elsif File.exist? ruby19_rake then
+ ruby19_rake
+ else
+ 'rake'
+ end
end