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

ruby-changes:24980

From: nobu <ko1@a...>
Date: Tue, 25 Sep 2012 11:14:33 +0900 (JST)
Subject: [ruby-changes:24980] nobu:r37032 (trunk): test_gem_installer.rb: restore ARGV

nobu	2012-09-25 11:14:18 +0900 (Tue, 25 Sep 2012)

  New Revision: 37032

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

  Log:
    test_gem_installer.rb: restore ARGV
    
    * test/rubygems/test_gem_installer.rb
      (TestGemInstaller#test_install_creates_binstub_that_dont_trust_encoding):
      restore ARGV properly, non-ascii strings in different encodings are
      not equal.  [ruby-core:45975] [Bug #6673]

  Modified files:
    trunk/test/rubygems/test_gem_installer.rb

Index: test/rubygems/test_gem_installer.rb
===================================================================
--- test/rubygems/test_gem_installer.rb	(revision 37031)
+++ test/rubygems/test_gem_installer.rb	(revision 37032)
@@ -747,7 +747,8 @@
 
     exe = File.join @gemhome, 'bin', 'executable'
 
-    ARGV.unshift "\xE4pfel".force_encoding("UTF-8")
+    extra_arg = "\xE4pfel".force_encoding("UTF-8")
+    ARGV.unshift extra_arg
 
     begin
       Gem::Specification.reset
@@ -756,7 +757,7 @@
         instance_eval File.read(exe)
       end
     ensure
-      ARGV.shift if ARGV.first == "\xE4pfel"
+      ARGV.shift if ARGV.first == extra_arg
     end
 
     assert_match(/ran executable/, e.message)

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

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