зеркало из https://github.com/github/ruby.git
Fix failures on non-UTF-8 environment [Bug #18077]
Call `IOSpecs.io_fixture` with the default encoding explicitly. `IOSpecs.closed_io` calls the method without optional `mode` which is set to UTF-8 by default, while the default external encoding depends on the locale environment variables.
This commit is contained in:
Родитель
18031f4102
Коммит
d574b84182
|
@ -96,7 +96,9 @@ describe "IO#external_encoding" do
|
|||
|
||||
ruby_version_is '3.1' do
|
||||
it "can be retrieved from a closed stream" do
|
||||
IOSpecs.closed_io.external_encoding.should equal(Encoding.default_external)
|
||||
io = IOSpecs.io_fixture("lines.txt", "r")
|
||||
io.close
|
||||
io.external_encoding.should equal(Encoding.default_external)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -115,7 +115,9 @@ describe "IO#internal_encoding" do
|
|||
|
||||
ruby_version_is '3.1' do
|
||||
it "can be retrieved from a closed stream" do
|
||||
IOSpecs.closed_io.internal_encoding.should equal(Encoding.default_internal)
|
||||
io = IOSpecs.io_fixture("lines.txt", "r")
|
||||
io.close
|
||||
io.internal_encoding.should equal(Encoding.default_internal)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче