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

Fix prompt test not to change STDIO.external_encoding #535

Merged
merged 1 commit into from
Mar 3, 2023

Conversation

tompng
Copy link
Member

@tompng tompng commented Mar 2, 2023

In the test I added in #528, I forgot to pass TestInputMethod as input_method to IRB::Irb.new, and it caused changing STDOUT.external_encoding from nil to utf-8 in the test case

@ima1zumi
Copy link
Member

ima1zumi commented Mar 3, 2023

Warnings seems to be resolved with #536.

@tompng
Do you need to make any additional changing? For example, adding TestInputMethod.new.

@st0012
Copy link
Member

st0012 commented Mar 3, 2023

I've hit the similar problem before, so I added these helpers that we can use in test setup/cleanup.

@tompng tompng force-pushed the fix_prompt_main_test_external_encoding branch from 7f6dd42 to c6c8dac Compare March 3, 2023 10:00
@tompng tompng force-pushed the fix_prompt_main_test_external_encoding branch from c6c8dac to 856f744 Compare March 3, 2023 10:03
@tompng
Copy link
Member Author

tompng commented Mar 3, 2023

Do you need to make any additional changing?

I need it to avoid changing external_encoding

I use TestInputMethod.new for not changing the encoding because not specifying the input was a fault, and also use the helper to ensure it.
Thanks for the information about the helpers

@tompng tompng merged commit 09f1625 into ruby:master Mar 3, 2023
@tompng tompng deleted the fix_prompt_main_test_external_encoding branch March 3, 2023 10:18
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.

4 participants