Repository navigation
Process::Status#success? returns nil if the process has not exited - #3260
Merged
Merged
Conversation
`success?` returns `nil` when the child did not exit, for example when it was killed by a signal. The comment above the signature already says so, but the return type was `bool`. Add a test that covers the true, false and nil cases. Assisted-by: Claude:claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Process::Status#success?returnsnilwhen the process has not exited, for example when it was killed by a signal. The RDoc comment above the signature already lists that case (success? -> true, false, or nil), but the return type wasbool:This changes the return type to
bool?and addsProcess_StatusInstanceTest#test_success?, which checks thetrue(exit),false(exit 1) andnil(child killed withSIGKILL) cases withassert_send_type.Tested with Ruby 4.0.9 (
ruby -Ilib bin/test_runner.rb test/stdlib/Process_test.rb, with the extension compiled from this checkout):Call trace does not match one of method definitionsat the() -> nilassertion() -> bool?rbs validatepasses, and rubocop (withrubocop-on-rbsand the stdlib test cop) reports no offenses on the two changed files.AI disclosure: this change was prepared with Claude Code (Claude Opus 5.5), which compared the signature with the RDoc and the runtime behavior, made the change, wrote the test and ran the checks above.