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

Use assert_raises instead of assert_raise for SocketError #22

Closed

Conversation

shioimm
Copy link
Contributor

@shioimm shioimm commented Nov 23, 2023

The following PR changes cause Socket::ResolutionError, a subclass of SocketError, to be raised in this test case. ruby/ruby#9018

While assert_raise verifies that the error being raised is indeed a SocketError, assert_raises can verify that it is a SocketError or a subclass thereof. It will avoid unwanted test failures.

The following PR changes cause Socket::ResolutionError, a subclass of SocketError, to be raised in this test case.
ruby/ruby#9018

While `assert_raise` verifies that the error being raised is indeed a SocketError, `assert_raises` can verify that it is a SocketError or a subclass thereof. It will avoid unwanted test failures.
@hsbt
Copy link
Member

hsbt commented Nov 27, 2023

assert_raises is only for minitest, not test-unit.

@shioimm
Copy link
Contributor Author

shioimm commented Nov 29, 2023

Thank you to your feedback. Now I opened a new PR #23 for the changes.

@shioimm shioimm closed this Nov 29, 2023
@shioimm shioimm deleted the use-assert_raises-for-SocketError branch November 29, 2023 09: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.

2 participants