-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Enhancement] #151
Comments
Thanks @navijatio. I love this idea. I would make it even strict: to force only the checked value to be only a function call, that only returns one value of error type. Do you want to implement this? |
@nunnatsa yeah that makes sense, |
Thinking about it again, this is a good linter rule, but I think the real fix will be to fix the For example, this is a very common patterns when using gomega: _, err := funcReturnsValueAndError()
Expect(err).ToNot(HaveOccurred())
...
Expect(funcReturnsOnlyError()).To(Succeed()) I think it makes more sense that the this code will work: Expect(funcReturnsValueAndError()).To(Succeed())
...
Expect(funcReturnsOnlyError()).To(Succeed()) @onsi - what do you think? |
Is your feature request related to a problem? Please describe.
To(Succeed())
in Ginkgo has the rather peculiar behavior of failing when theExpect
takes in multiple arguments. It is considered a misuse to useSucceed
in this context according to Gomega docs.Describe the solution you'd like
Report an error if
Expect(someFunction()).To(Succeed())
is called and the function returns multiple values, or if the number of arguments toExpect
here is greater than 1.Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: