summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-29 22:48:11 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-29 22:48:11 +0000
commite88b59560e2c5e6e1408c6f39f389e65cc5ce957 (patch)
treed14d2643f6e850bff2b40809d4b97018b278866c /test
parentfa890b6f7b16fe162ca9c52b4514dbf879ad78e4 (diff)
downloadruby-e88b59560e2c5e6e1408c6f39f389e65cc5ce957.tar.gz
ruby-e88b59560e2c5e6e1408c6f39f389e65cc5ce957.tar.xz
ruby-e88b59560e2c5e6e1408c6f39f389e65cc5ce957.zip
Fix some RDoc and RubyGems test interactions. Fix -n in test/runner.rb
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/rdoc/test_rdoc_markup_attribute_manager.rb7
-rw-r--r--test/rubygems/gemutilities.rb7
-rw-r--r--test/runner.rb2
3 files changed, 16 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_markup_attribute_manager.rb b/test/rdoc/test_rdoc_markup_attribute_manager.rb
index eea87822a..cf10ff9f2 100644
--- a/test/rdoc/test_rdoc_markup_attribute_manager.rb
+++ b/test/rdoc/test_rdoc_markup_attribute_manager.rb
@@ -5,6 +5,9 @@ require "rdoc/markup/to_html_crossref"
class TestRDocMarkupAttributeManager < Test::Unit::TestCase
def setup
+ @orig_special = RDoc::Markup::AttributeManager::SPECIAL
+ RDoc::Markup::AttributeManager::SPECIAL.replace Hash.new
+
@am = RDoc::Markup::AttributeManager.new
@bold_on = @am.changed_attribute_by_name([], [:BOLD])
@@ -28,6 +31,10 @@ class TestRDocMarkupAttributeManager < Test::Unit::TestCase
@wombat_off = @am.changed_attribute_by_name([:WOMBAT], [])
end
+ def teardown
+ RDoc::Markup::AttributeManager::SPECIAL.replace @orig_special
+ end
+
def crossref(text)
crossref_bitmap = RDoc::Markup::Attribute.bitmap_for(:_SPECIAL_) |
RDoc::Markup::Attribute.bitmap_for(:CROSSREF)
diff --git a/test/rubygems/gemutilities.rb b/test/rubygems/gemutilities.rb
index 8083875f4..f118f89a7 100644
--- a/test/rubygems/gemutilities.rb
+++ b/test/rubygems/gemutilities.rb
@@ -57,6 +57,7 @@ class RubyGemTestCase < Test::Unit::TestCase
@latest_usrcache = File.join(@gemhome, ".gem", "latest_user_cache")
@userhome = File.join @tempdir, 'userhome'
+ @orig_ENV_HOME = ENV['HOME']
ENV['HOME'] = @userhome
Gem.instance_variable_set :@user_home, nil
@@ -131,6 +132,12 @@ class RubyGemTestCase < Test::Unit::TestCase
ENV.delete 'GEM_PATH'
Gem.clear_paths
+
+ if @orig_ENV_HOME then
+ ENV['HOME'] = @orig_ENV_HOME
+ else
+ ENV.delete 'HOME'
+ end
end
def install_gem gem
diff --git a/test/runner.rb b/test/runner.rb
index fb72c7155..fe827f921 100644
--- a/test/runner.rb
+++ b/test/runner.rb
@@ -33,6 +33,8 @@ until ARGV.empty? do
other.push(*ARGV)
ARGV.clear
break
+ when /^-(n|-name)$/ then
+ other.push arg, ARGV.shift
when /^-/ then
other << arg
else