summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-02 04:10:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-02 04:10:36 +0000
commit51e738561a87479f7730144bf6ce1133f724b704 (patch)
tree22d20751d17930a6651acfd2b33c034661ba118c /test
parent1e1964b8f2edeba4dabab2d20b2b56e93a2e0257 (diff)
downloadruby-51e738561a87479f7730144bf6ce1133f724b704.tar.gz
test_require.rb: filesystem encoding
* test/ruby/test_require.rb (assert_require_nonascii_path): the path in error message is converted to filesystem encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_require.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index dad7630e50..2e62300281 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -92,7 +92,6 @@ class TestRequire < Test::Unit::TestCase
nil
else
proc do |require_path|
- File.chmod(0777, File.dirname(require_path))
$SAFE = 1
require(require_path)
end
@@ -123,8 +122,9 @@ class TestRequire < Test::Unit::TestCase
$:.replace(load_path)
$".replace(features)
if SECURITY_WARNING
+ File.chmod(0777, File.dirname(require_path))
require_path.untaint
- ospath = require_path.encode(self.class.ospath_encoding(require_path))
+ ospath = require_path.encode('filesystem')
assert_warn(/Insecure world writable dir/) do
assert_raise_with_message(SecurityError, "loading from unsafe path #{ospath}") do
SECURITY_WARNING.call(require_path)