This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-13
Channels
- # aleph (5)
- # beginners (92)
- # cider (37)
- # cljs-dev (38)
- # cljsjs (2)
- # cljsrn (3)
- # clojure (50)
- # clojure-berlin (1)
- # clojure-canada (3)
- # clojure-dusseldorf (4)
- # clojure-france (1)
- # clojure-germany (1)
- # clojure-italy (7)
- # clojure-nl (21)
- # clojure-spec (2)
- # clojure-uk (106)
- # clojurescript (165)
- # code-reviews (1)
- # community-development (3)
- # cursive (5)
- # datomic (13)
- # editors (12)
- # emacs (3)
- # figwheel-main (141)
- # fulcro (28)
- # graphql (1)
- # immutant (1)
- # jobs (1)
- # jobs-discuss (5)
- # midje (8)
- # nrepl (3)
- # off-topic (28)
- # onyx (4)
- # re-frame (21)
- # reagent (70)
- # ring (2)
- # ring-swagger (9)
- # shadow-cljs (18)
- # spacemacs (6)
- # specter (23)
- # tools-deps (21)
Hi all. I'm trying to wrap my head around how to use (provided)
.
What I'm doing is refactoring a library that calls out to git. The previous interface was (git-command "describe --long --match v*.*")
, where everything is one string.
In my refactoring I'm changing the API so that it accepts a vararg list of strings instead: (git-command "describe" "--long" "--match" "v*.*")
What I'm having trouble with is trying to refactor tests that resemble this:
(fact "dirty missing tag and fallback is parsed"
(version) => (just [nil 2 "abcd" true])
(provided
(#'leiningen.v.git/git-command #"describe.*")
=> [(format "%s-%s" (subs "abcdef0123456789" 0 *min-sha-length*) *dirty-mark*)] [...]
As I read it, the existing test is "when the single argument to git-command begins with describe
, return this"
What I'd like to do is change it to something more like (provided (#'leiningen.v.git/git-command "describe" anything) => [...])
, so if the first parameter to the function is the literal string "describe"
it returns the value given
...but I can't figure out if there are midje controls to do this, does anyone know?
Aha! Got it, the syntax I was looking for was (#'leiningen.v.git/git-command "describe" & anything)