mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
18031f4102
commit
d574b84182
2 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue