-
-
Notifications
You must be signed in to change notification settings - Fork 638
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
negated matcher for be_able_to only passes when no ability is eligible #646
base: develop
Are you sure you want to change the base?
negated matcher for be_able_to only passes when no ability is eligible #646
Conversation
3dc242b
to
ceaf15f
Compare
Issue with description: #645 |
ceaf15f
to
b439cc0
Compare
What's the state of this PR? Can it be merged? |
f8494f3
to
6f5b529
Compare
@ghiculescu thanks for the comment, I have updated the PR with a squashed commit including the correct commit message in the changelog, also resolved the merge conflict. |
6f5b529
to
c1c6cca
Compare
I think we discussed this issue too often. But something changed recently: I found out this behaviour in RSpec, you can define:
this is very similar to what we are discussing here. Guess what does RSpec do? It raises
I think we should do the same |
Sorry @mraidel , I was in a rush (and maybe a bit rude 😅 ) in my comment above. I really appreciate the effort you did put in this PR 🙏 . I'd love to get your feedback regarding my proposal. |
Hi @coorasse, I understand the RSpec behavior for "all" because it mirrors the use of the language, "not all" just doesn't mean "none". I don't see the same issue in ".not_to be_able_to" because in this case for me the new behavior also mirrors the language. If I say "I don't want to be able to do these things" I would expect that I can do none of these, right? An alternative solution would be to disallow the negated matcher and have a new matcher "be_unable_to". Maybe there is still some possible ambiguity because one could interpret it either as "not be able to do a and b" or "not to be able to do a or b". In this case the only solution I would see is to disallow using the negated matcher with more than one argument. Just disallowing the negated matcher would miss any way to test for someone unable to access something which I think is a quite important thing to test. |
I would disallow it only with multiple actions. You would still be able to run it with a single action. |
No description provided.