-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
syntactic sugar tweak for clojure dsl #244
Comments
After looking at the cucumber-jvm Clojure DSL code, this is how I now do it in my step definition code:
This would be pretty much the exact code I would add to https://github.com/cucumber/cucumber-jvm/blob/master/clojure/src/main/resources/cucumber/runtime/clojure/dsl.clj |
I don't know enough Clojure to have an opinion on this, so if you say this is better I'm sure it is! Please send along the pullreq. |
Just noticed that this will probably be obsolete if the clojure-native pull request is merged (#265). |
Yes, obsolete now |
So by obsolete do you mean it is incompatible? I agree, that is the case. However, I would still like to add this feature to cucumber-jvm. It will just need to be written differently. |
See comment in #248 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
In my cucumber step definitions I find it convenient to wrap the Given/When/Then macros in what I consider to be slightly better syntactic sugar.
For example:
It occurred to me that there's no reason to expose the (fn [] ... ) in step definitions, for any use case I can imagine. So why not make this the default syntax?
Looking at the way the dsl is implemented I think the best way to do this is not to change the implementation of stepdef at all, but just replace for example
(def Given stepdef)
with a defmacro expressions similar the one shown above.If you agree with this feature, I'll submit a pull request for a modified clojure/src/main/resources/cucumber/runtime/clojure/dsl.clj
The text was updated successfully, but these errors were encountered: