This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-18
Channels
- # admin-announcements (3)
- # alda (1)
- # boot (85)
- # capetown (4)
- # cider (10)
- # clara (16)
- # cljsrn (3)
- # clojars (35)
- # clojure (83)
- # clojure-austin (8)
- # clojure-brasil (4)
- # clojure-canada (16)
- # clojure-greece (2)
- # clojure-ireland (7)
- # clojure-russia (23)
- # clojure-spec (22)
- # clojure-uk (151)
- # clojurescript (97)
- # core-async (10)
- # cursive (1)
- # datascript (7)
- # datomic (21)
- # defnpodcast (13)
- # devcards (3)
- # emacs (4)
- # events (3)
- # hoplon (18)
- # juxt (4)
- # leiningen (7)
- # mount (4)
- # off-topic (2)
- # om (1)
- # onyx (30)
- # planck (6)
- # proton (81)
- # re-frame (3)
- # reagent (9)
- # rum (10)
- # spacemacs (1)
- # specter (6)
- # testing (7)
- # untangled (66)
- # vim (84)
- # yada (23)
Any hints on limiting :num-tests
in stest/check
? (stest/check b/match-klasses {:clojure.spec.test/opts {:num-tests 10}})
isn’t working. It’s gotta be something simple I’m missing.
Whoops, found it!:
(stest/check b/match-klasses {:clojure.spec.test.check/opts {:num-tests 10}})
I'm struggling to create a spec for dates with a custom conformer, unformer, and generator. I'd love input on how to make this work or if I'm just trying to fit a square peg into a round hole. See the snippet for my attempts.
@kendall.buchanan quick tip: you can probably replace :clojure.spec.test.check/opts
with ::stest/opts
Ah, will ::stest/opts
create an alias?
when you import a namespace into a short name (like stest
for clojure.spec.test.check
) you can use double colon notation ::
and the namespace will be expanded
@kendall.buchanan @wilkerlucio I think in this case stest
resolves to clojure.spec.test
, not clojure.spec.test.check
, so you can't use it here.
correct
that was the part I wasn't sure, to where the alias was pointing, eheh
In any case, I made myself a helper function and referenced that instead.
I'm looking forward for the feature that will enable us to alias namespaces without having to require it (specially good for referencing namespaces that not exists, for namespacing only), alex said it's on the table
that would be handy
@wilkerlucio: Did you see the workaround Alex posted? Using in-ns
to create the namespace in memory without needing a file for it.
@seancorfield: I didn't, seems cool, do you know if that works with cljs?
Sorry, no idea.
@seancorfield: do you have the snippet for that? I tried to search here, but no lucky
Oh, you just use (in-ns 'qualified.keyword.namespace) (in-ns 'original.namespace)
to create qualified.keyword.namespace
in memory and then switch back to whatever ns you were in.
Then you can do (alias 'q 'qualified.keyword.namespace)
— because that ns exists now — and then ::q/k
expands to :qualified.keyword.namespace/k
as "expected".
If anyone is curious, I solved my problem above with a dirty hack that relies heavily on implementation. (See snippet.)
If with-gen*
passed unc
along to spec-impl
, I could do it with just spec
.