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

Change return type of lifecycle hooks in minitest to be void #1694

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

stevegeek
Copy link
Contributor

Hi all, many thanks for all the work on RBS.

I am proposing a change to the Lifecycle hooks of Minitest::Test so that they are void instead of nil.

Otherwise any time we use the setup hook for example, we need to explicitly return nil but normally we don't care what we return from these methods. The return value is not used in minitest I believe (https://github.com/minitest/minitest/blob/master/lib/minitest/test.rb#L91)

I wasn't really sure about how to use the assert_send_type test helper but I tried to write a test anyway.

Let me know what you think.

@ksss
Copy link
Collaborator

ksss commented Dec 21, 2023

I agree with you.
These types are generated by rbs prototype rb, so there is no special intention.
LGTM!

@soutaro soutaro added this pull request to the merge queue Dec 21, 2023
@soutaro soutaro added this to the RBS 3.4 milestone Dec 21, 2023
Merged via the queue into ruby:master with commit 761889d Dec 21, 2023
23 checks passed
@soutaro soutaro added the Released PRs already included in the released version label Dec 21, 2023
@stevegeek
Copy link
Contributor Author

Thanks @ksss !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released PRs already included in the released version
Development

Successfully merging this pull request may close these issues.

3 participants