Ghostwheel: Hassle-free clojure.spec, side effect detection and evaluation tracing


#1

Just stumbled upon https://github.com/gnl/ghostwheel and I am so impressed I have to share it!

Instead of

imagine

and other goodies :slight_smile:


#2

I’ve been checking it out as well and it looks pretty interesting, especially the automatic function testing.


#3

How does it distinguishes itself from orchestra?


#4

It seems to do a whole lot more than orchestra, and can use orchestra for instrumentation. The Readme has a pretty good introduction and documentation of the functionality.


#5
(ns test-chamber.one
  #:ghostwheel.core{:check     true
                    :num-tests 10}
  ...)

Never seen this ns syntax, doesn’t seem to work in Clojure. Is this ClojureScript only?


#6

Ghostwheel author here – the syntax is standard Clojure syntax for adding metadata to the namespace via the attr-map? parameter to ns:
https://clojuredocs.org/clojure.core/ns

Should work identically on Clojure and ClojureScript. A reason why it may not is if you’re using Clojure 1.8.0 or older, because this is a namespaced map, support for which was introduced with Clojure 1.9.0.

Using it is not required, but since Ghostwheel uses qualified keywords for its configuration, the alternative would be quite verbose:

{:ghostwheel.core/check     true
 :ghostwheel.core/num-tests 10}

#7

Right on, I’m still on 1.8, so havn’t gotten used to seeing that new syntax.