-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
feat: Additional mutations around ordering #1442
Comments
mbj
added a commit
that referenced
this issue
May 12, 2024
Merged
mbj
added a commit
that referenced
this issue
May 12, 2024
@AndrewSwerlick I like this but split out |
mbj
added a commit
that referenced
this issue
May 12, 2024
mbj
added a commit
that referenced
this issue
May 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Suggestion:
Mutant should include mutations that replace methods like
find/detect/min/max/min_by/max_by/last
withfirst
andlast
Justification
The methods
min/max/min_by/max_by
all accept a block. However if there is only 1 item in the collection, the block will not executed, and potentially remain untested. It's an easy fact to overlook in your tests. In those situations a mutation tofirst
will result in a live mutation, making the missing coverage obvious.Additionally mutating to last will detect when your sort conditions aren't being properly exercised because all the records sort in the same order.
find/detect
are some what different, since the blocks for those methods will always execute, but it will still help to ensure that your test setup creates collections that both include and exclude the values you're working with.The text was updated successfully, but these errors were encountered: