summaryrefslogtreecommitdiff
path: root/spec/ruby/core/dir
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2022-03-28 17:47:04 +0200
committerBenoit Daloze <eregontp@gmail.com>2022-03-28 17:47:04 +0200
commit8db4f25bf4327f169902afd9ea8f4b03b65656f0 (patch)
treead61b99fb2d5ebfe9c07de8c2b5885e80d20b8e1 /spec/ruby/core/dir
parentae650f0372e10cea4d695769b1fcdc23a76fdf17 (diff)
Update to ruby/spec@aaf998f
Diffstat (limited to 'spec/ruby/core/dir')
-rw-r--r--spec/ruby/core/dir/foreach_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/ruby/core/dir/foreach_spec.rb b/spec/ruby/core/dir/foreach_spec.rb
index c3ddb27a84..85e8c61fd6 100644
--- a/spec/ruby/core/dir/foreach_spec.rb
+++ b/spec/ruby/core/dir/foreach_spec.rb
@@ -42,6 +42,13 @@ describe "Dir.foreach" do
it "accepts an encoding keyword for the encoding of the entries" do
dirs = Dir.foreach("#{DirSpecs.mock_dir}/deeply/nested", encoding: "utf-8").to_a.sort
dirs.each {|dir| dir.encoding.should == Encoding::UTF_8}
+
+ dirs = Dir.foreach("#{DirSpecs.mock_dir}/deeply/nested", encoding: Encoding::UTF_16LE).to_a.sort
+ dirs.each {|dir| dir.encoding.should == Encoding::UTF_16LE}
+
+ Dir.foreach("#{DirSpecs.mock_dir}/deeply/nested", encoding: Encoding::UTF_16LE) do |f|
+ f.encoding.should == Encoding::UTF_16LE
+ end
end
ruby_version_is ""..."2.7" do