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

ruby-changes:30134

From: nobu <ko1@a...>
Date: Fri, 26 Jul 2013 13:20:11 +0900 (JST)
Subject: [ruby-changes:30134] nobu:r42186 (trunk): test_require.rb: same process

nobu	2013-07-26 13:19:56 +0900 (Fri, 26 Jul 2013)

  New Revision: 42186

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

  Log:
    test_require.rb: same process
    
    * test/ruby/test_require.rb (assert_require_nonascii_path): run in
      same process.

  Modified files:
    trunk/test/ruby/test_require.rb

Index: test/ruby/test_require.rb
===================================================================
--- test/ruby/test_require.rb	(revision 42185)
+++ test/ruby/test_require.rb	(revision 42186)
@@ -78,17 +78,21 @@ class TestRequire < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_require.rb#L78
       end
       Dir.mkdir(File.dirname(require_path))
       open(require_path, "wb") {}
-      assert_separately(%w[--disable=gems], <<-INPUT)
+      begin
+        load_path = $:.dup
+        features = $".dup
         # leave paths for require encoding objects
         bug = "#{bug} require #{encoding} path"
         require_path = "#{require_path}"
-        enc_path = Regexp.new(Regexp.escape(RUBY_PLATFORM))
-        $:.replace([IO::NULL] + $:.reject {|path| enc_path !~ path})
+        $:.clear
         assert_nothing_raised(LoadError, bug) {
           assert(require(require_path), bug)
           assert(!require(require_path), bug)
         }
-      INPUT
+      ensure
+        $:.replace(load_path)
+        $".replace(features)
+      end
     }
   end
 

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

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