Created
October 15, 2014 20:47
-
-
Save CraZySacX/cb5c5d8d522a80b778aa to your computer and use it in GitHub Desktop.
Evaluating macro arguments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def post-cfg {:ctx "/account POST" | |
:dba :start | |
:reqfn (as-admin (account-post)) | |
:expected-status 200 | |
:expected-message :localized/account-created}) | |
(defmacro edn-req [{:keys [ctx dba reqfn sep | |
expected-status expected-message] | |
:or {sep true}}] | |
`(context | |
~ctx | |
(before-all (start-stop-datomic ~dba)) | |
(after-all (if ~sep (println))) | |
(with-all ar# ~reqfn))) | |
; THIS DOES NOT WORK | |
(edn-req post-cfg) | |
; THIS WORKS | |
(edn-req {:ctx "/account POST" | |
:dba :start | |
:reqfn (as-admin (account-post)) | |
:expected-status 200 | |
:expected-message :localized/account-created}) | |
ckirkendall
commented
Oct 15, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment