-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
renaming iterableAssertions to consistent to + infitinive
naming schema
#889
Conversation
cannot rename all files because of git mv incapabilities. Would loose history otherwise.
cannot rename all files because of git mv incapabilities. Would loose history otherwise.
because we rename containsNot to notToContain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the code, I take issue with toHaveNextAndAny
and toHaveNextAndAll
.
First, when reading the function, I first did not understand what they do. My mind tried to parse them as ‘to have: (next and all {})’, which makes no sense. Only after backtracking I noticed that it’s meant to be ‘(to have next), (and all {})’.
Second, I generally expect an expectation function to ‘do one thing’. Yes, there are expectation functions that do other implied checks, but that is different from one function doing two inherently different things.
I was going to suggest that we split the two and let users drop in the and
if they want, i.e. toHaveNext.and.all {}
. However, I remembered that you are afraid of users using all
without realizing that it does not imply a toHaveNext
check. I still don’t share that fear, I think an all
check that passes for empty collections is entirely reasonable. However, I don’t want to re-start the discussion.
So I guess all I can do is give feedback that I find toHaveNextAndAny
irritating. I have no better solution that would not involve splitting the toHaveNext
and any
check, though.
...GB-common/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/charSequenceContainsCheckers.kt
Outdated
Show resolved
Hide resolved
...GB-common/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/charSequenceContainsCheckers.kt
Outdated
Show resolved
Hide resolved
...GB-common/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/charSequenceContainsCheckers.kt
Outdated
Show resolved
Hide resolved
...GB-common/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/charSequenceContainsCheckers.kt
Show resolved
Hide resolved
...GB-common/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/charSequenceContainsCheckers.kt
Outdated
Show resolved
Hide resolved
@jGleitz thanks for the feedback
I should have mentioned in the description what I plan to do in a next PR. I realised that for Yet, seeing that you are confused if we leave out Element, is a bad sign. I'll see if I can come up with a better solution. Edit: I think toHaveElementsAndAll would already be better, no? I think if we have this then I don't introduce notToBeEmptyAndAll in addition, toHaveElements is good enough also for collection IMO. |
Codecov Report
@@ Coverage Diff @@
## master #889 +/- ##
==========================================
+ Coverage 90.82% 90.88% +0.05%
==========================================
Files 408 410 +2
Lines 4056 4091 +35
Branches 211 211
==========================================
+ Hits 3684 3718 +34
- Misses 322 323 +1
Partials 50 50
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Yes, I think so. How will the version of |
I suggest |
same same notToHaveNext as well as for toHaveNextAndAll/Any/None
I confirm that I have read the Contributor Agreements v1.0, agree to be bound on them and confirm that my contribution is compliant.