Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for combination of {bin,text}mode and external_encoding in ... #1076

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

herwinw
Copy link
Member

@herwinw herwinw commented Sep 10, 2023

…IO.new

The encoding option takes precedence over the binmode/textmode options. There are similar tests for passing the binmode argument in the mode argument.

…IO.new

The encoding option takes precedence over the binmode/textmode options.
There are similar tests for passing the binmode argument in the mode
argument.
@herwinw herwinw marked this pull request as ready for review September 10, 2023 11:16
@@ -208,6 +208,26 @@
@io.internal_encoding.to_s.should == 'IBM866'
end

it "does not use binmode argument when mode encoding is specified" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion:

Suggested change
it "does not use binmode argument when mode encoding is specified" do
it "does not use binary encoding when mode encoding is specified along with binmode: true option" do

Actually it uses the binmode argument and #binmode? will return a specified value. But it doesn't affect io encoding.

There is a test for "b" mode and internal_encoding. Shouldn't we have a similar case with binmode/textmode options as well?

@herwinw herwinw marked this pull request as draft September 25, 2023 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants