Prefer the simple read/write File singleton methods

This commit is contained in:
Nobuyoshi Nakada 2024-03-16 23:44:07 +09:00
parent d4a53b465a
commit aae9f5628c
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

View File

@ -362,7 +362,7 @@ class TestDir_M17N < Test::Unit::TestCase
def test_glob_encoding
with_tmpdir do
list = %W"file_one.ext file_two.ext \u{6587 4ef6}1.txt \u{6587 4ef6}2.txt"
list.each {|f| open(f, "w") {}}
list.each {|f| File.binwrite(f, "")}
a = "file_one*".dup.force_encoding Encoding::IBM437
b = "file_two*".dup.force_encoding Encoding::EUC_JP
assert_equal([a, b].map(&:encoding), Dir[a, b].map(&:encoding))