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

ruby-changes:30130

From: nobu <ko1@a...>
Date: Fri, 26 Jul 2013 13:04:28 +0900 (JST)
Subject: [ruby-changes:30130] nobu:r42182 (trunk): test_require.rb: split

nobu	2013-07-26 13:04:18 +0900 (Fri, 26 Jul 2013)

  New Revision: 42182

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

  Log:
    test_require.rb: split
    
    * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path):
      split test body.

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

Index: test/ruby/test_require.rb
===================================================================
--- test/ruby/test_require.rb	(revision 42181)
+++ test/ruby/test_require.rb	(revision 42182)
@@ -61,8 +61,12 @@ class TestRequire < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_require.rb#L61
 
   def test_require_nonascii_path
     bug8165 = '[ruby-core:53733] [Bug #8165]'
+    encoding = /mswin|mingw/ =~ RUBY_PLATFORM ? 'filesystem' : 'UTF-8'
+    assert_require_nonascii_path(encoding, bug8165)
+  end
+
+  def assert_require_nonascii_path(encoding, bug)
     Dir.mktmpdir {|tmp|
-      encoding = /mswin|mingw/ =~ RUBY_PLATFORM ? 'filesystem' : 'UTF-8'
       dir = "\u3042" * 5
       begin
         require_path = File.join(tmp, dir, 'foo.rb').encode(encoding)
@@ -73,7 +77,7 @@ class TestRequire < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_require.rb#L77
       open(require_path, "wb") {}
       assert_separately(%w[--disable=gems], <<-INPUT)
         # leave paths for require encoding objects
-        bug = "#{bug8165} require #{encoding} path"
+        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})

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

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