-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
[Question] Groovy DSL: No EachLike validation #1076
Comments
That will be really hard to detect. The first example works because the The second example works because the builder uses the missing method functionality in Groovy, so The problem is that there is nothing to hook on too with the third. The outer closure is executed, which contains just the One thing I could try is checking the result of the closure, and if that is a matcher then maybe something is wrong. |
The return value works, I can detect that example. I can also detect this one: withBody {
fruits eachLike(1) {
regexp('.*', 'banana')
}
} However, if something else is returned from the closure, then there is nothing I can do. I.e., withBody {
eachLike(1) {
type regexp('.*', 'banana')
}
"fruits" // This will be the return value
} |
A raw array "eachLike":
produces:
A named array "eachLike":
produces:
A wrong DSL like:
produces:
but there is not warning or error regarding incorrect DSL usage.
Is there a way to produce an error or a warning in case "eachLike" is put in a wrong place inside "withBody" DSL?
Code examples can be found here: https://github.com/artamonovkirill/pact-issues-examples/tree/master/src/test/groovy/com/github/artamonovkirill/pact/eachlikevalidaiton
The text was updated successfully, but these errors were encountered: