Fork me on GitHub

What is the state of testing in clojure? I want to use bdd, what should I use? speclj?


Specification by example would be great


I am looking for a way to check if json that I am getting conforms to clojure spec. Problem is spec requires keys to be localized like ::a ::b , but when I use cheshire I get :a 😛. I am currently using clojure.spec/valid? to check if json conforms to spec is there something else I should be using?

Sam H11:04:42

@algiras it looks like you can use :req-un if you want to validate keys


Ou, your right! I tried it before and in specified :req-un [:a :b] and it failed. I just tried it using :req-un [::a ::b] and it worked. Thx


Is there any convention on how to keep your spec descriptions, should they be separated from the code or intermingled? If intermingled, should it be at the top of the file or before using a var and function that was described?


algiras: It's still being determined. Different people have some different preference, but no way is ideal yet, they each have different trade offs.


Thx for the reply. Hope until Clojure 1.9 stable release there will be some common good practices.

Sam H12:04:12

I haven’t used it personally, but I remember this reddit thread discussing some conventions:


Cool thx, hope at the near future I will have enough knowledge to contribute to these discussion.


I'm reading some code that has (.. Config. <stuff> ), what exactly is that first ..?


Is it this? (.. Config. (a) (b) (c option)) => Config.a().b().c(option)


it's like -> but only for method calls, so yes


@josh.freckleton amazingly (doc ..) works


(not sarcastic, I wanted to double check something as syntaxy as that would have docs)