diff options
Diffstat (limited to 'spec/ruby/core/dir')
-rw-r--r-- | spec/ruby/core/dir/children_spec.rb | 8 | ||||
-rw-r--r-- | spec/ruby/core/dir/entries_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/dir/shared/pwd.rb | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/spec/ruby/core/dir/children_spec.rb b/spec/ruby/core/dir/children_spec.rb index d28f1b1346..ef8b20b1f0 100644 --- a/spec/ruby/core/dir/children_spec.rb +++ b/spec/ruby/core/dir/children_spec.rb @@ -43,10 +43,10 @@ ruby_version_is "2.5" do it "returns children encoded with the filesystem encoding by default" do # This spec depends on the locale not being US-ASCII because if it is, the - # children that are not ascii_only? will be ASCII-8BIT encoded. + # children that are not ascii_only? will be BINARY encoded. children = Dir.children(File.join(DirSpecs.mock_dir, 'special')).sort encoding = Encoding.find("filesystem") - encoding = Encoding::ASCII_8BIT if encoding == Encoding::US_ASCII + encoding = Encoding::BINARY if encoding == Encoding::US_ASCII platform_is_not :windows do children.should include("こんにちは.txt".force_encoding(encoding)) end @@ -110,11 +110,11 @@ ruby_version_is "2.6" do it "returns children encoded with the filesystem encoding by default" do # This spec depends on the locale not being US-ASCII because if it is, the - # children that are not ascii_only? will be ASCII-8BIT encoded. + # children that are not ascii_only? will be BINARY encoded. @dir = Dir.new(File.join(DirSpecs.mock_dir, 'special')) children = @dir.children.sort encoding = Encoding.find("filesystem") - encoding = Encoding::ASCII_8BIT if encoding == Encoding::US_ASCII + encoding = Encoding::BINARY if encoding == Encoding::US_ASCII platform_is_not :windows do children.should include("こんにちは.txt".force_encoding(encoding)) end diff --git a/spec/ruby/core/dir/entries_spec.rb b/spec/ruby/core/dir/entries_spec.rb index 488acec81b..ed45287e82 100644 --- a/spec/ruby/core/dir/entries_spec.rb +++ b/spec/ruby/core/dir/entries_spec.rb @@ -42,10 +42,10 @@ describe "Dir.entries" do it "returns entries encoded with the filesystem encoding by default" do # This spec depends on the locale not being US-ASCII because if it is, the - # entries that are not ascii_only? will be ASCII-8BIT encoded. + # entries that are not ascii_only? will be BINARY encoded. entries = Dir.entries(File.join(DirSpecs.mock_dir, 'special')).sort encoding = Encoding.find("filesystem") - encoding = Encoding::ASCII_8BIT if encoding == Encoding::US_ASCII + encoding = Encoding::BINARY if encoding == Encoding::US_ASCII platform_is_not :windows do entries.should include("こんにちは.txt".force_encoding(encoding)) end diff --git a/spec/ruby/core/dir/shared/pwd.rb b/spec/ruby/core/dir/shared/pwd.rb index 94fc2fa7fb..2a8d7fe790 100644 --- a/spec/ruby/core/dir/shared/pwd.rb +++ b/spec/ruby/core/dir/shared/pwd.rb @@ -37,7 +37,7 @@ describe :dir_pwd, shared: true do it "returns a String with the filesystem encoding" do enc = Dir.send(@method).encoding if @fs_encoding == Encoding::US_ASCII - [Encoding::US_ASCII, Encoding::ASCII_8BIT].should include(enc) + [Encoding::US_ASCII, Encoding::BINARY].should include(enc) else enc.should equal(@fs_encoding) end |