[前][次][番号順一覧][スレッド一覧]

ruby-changes:8107

From: drbrain <ko1@a...>
Date: Tue, 30 Sep 2008 07:48:26 +0900 (JST)
Subject: [ruby-changes:8107] Ruby:r19633 (trunk): Fix some RDoc and RubyGems test interactions. Fix -n in test/runner.rb

drbrain	2008-09-30 07:48:11 +0900 (Tue, 30 Sep 2008)

  New Revision: 19633

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19633

  Log:
    Fix some RDoc and RubyGems test interactions. Fix -n in test/runner.rb

  Modified files:
    trunk/ChangeLog
    trunk/test/rdoc/test_rdoc_markup_attribute_manager.rb
    trunk/test/rubygems/gemutilities.rb
    trunk/test/runner.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19632)
+++ ChangeLog	(revision 19633)
@@ -1,3 +1,10 @@
+Tue Sep 30 07:46:07 2008  Eric Hodel  <drbrain@s...>
+
+	* test/rdoc/test_rdoc_markup_attribute_manager.rb: Test with clean
+	  SPECIALS.
+	* test/rubygems/gemutilities.rb: Restore ENV['HOME'] after test.
+	* test/runner.rb: Pass -n argument down to miniunit.
+
 Tue Sep 30 01:02:55 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (token_info_push, token_info_pop): do nothing for evaled
Index: test/rdoc/test_rdoc_markup_attribute_manager.rb
===================================================================
--- test/rdoc/test_rdoc_markup_attribute_manager.rb	(revision 19632)
+++ test/rdoc/test_rdoc_markup_attribute_manager.rb	(revision 19633)
@@ -5,6 +5,9 @@
 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 @@
     @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)
Index: test/rubygems/gemutilities.rb
===================================================================
--- test/rubygems/gemutilities.rb	(revision 19632)
+++ test/rubygems/gemutilities.rb	(revision 19633)
@@ -57,6 +57,7 @@
     @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 @@
     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
Index: test/runner.rb
===================================================================
--- test/runner.rb	(revision 19632)
+++ test/runner.rb	(revision 19633)
@@ -33,6 +33,8 @@
     other.push(*ARGV)
     ARGV.clear
     break
+  when /^-(n|-name)$/ then
+    other.push arg, ARGV.shift
   when /^-/ then
     other << arg
   else

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]