summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-26 04:04:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-26 04:04:18 +0000
commit2c181b6d1a0514204e049e5f37529b8b8ccfe434 (patch)
treec6e27c85310802a1b3327c49c6f34db9520b942a /test
parentf375a8b40ec65991df54d84856851c2149f11211 (diff)
test_require.rb: split
* test/ruby/test_require.rb (TestRequire#test_require_nonascii_path): split test body. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_require.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 78ddfab14a6..8d40f3dd804 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -61,8 +61,12 @@ class TestRequire < Test::Unit::TestCase
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
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})