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 coverage #1445

Merged
merged 2 commits into from
May 12, 2024
Merged

Fix coverage #1445

merged 2 commits into from
May 12, 2024

Conversation

mbj
Copy link
Owner

@mbj mbj commented May 12, 2024

No description provided.

@mbj mbj self-assigned this May 12, 2024
@@ -12,9 +12,12 @@ module Util
#
# @return [Object] first entry
def self.one(array)
return array.first if array.one?
Copy link
Owner Author

Choose a reason for hiding this comment

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

Array#one? comes form Enumerable#one? which returns true if there is one item that returns truthy. So [nil].one? would return false which is not the intention of this code.

There is no call side in mutant that would have been affected by the behavior difference, still it has to be fixed.

@mbj mbj merged commit a8b5509 into main May 12, 2024
100 checks passed
@mbj mbj deleted the fix/coverge branch May 12, 2024 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant