test-check

2019-05-27T16:16:43.002700Z

Hi, everyone I was wondering how can I use clojure.test/use-fixture with test-checkโ€™s defspec?

ossoso 2022-07-28T05:39:36.178299Z

How would I emulate the use of fixtures for each trial? Macro/higher order function?

2022-07-29T00:26:39.078509Z

Higher order function is what I've used before.

ossoso 2022-07-29T08:59:26.096909Z

I ended up writing the following macro:

(defmacro db-fixture [& body]
  `(with-open [node# (db/start-node {})]
     (binding [*node* node#]
       ~@body)))

๐Ÿ‘ 1
2019-05-27T16:28:19.003400Z

@ho0man is your issue that you want the fixture to run around each trial?

2019-05-27T16:29:05.004Z

Nope, the whole test

2019-05-27T16:30:18.005Z

But separately for different tests in a single namespace

2019-05-27T16:30:55.005400Z

I think that should just work

2019-05-27T16:30:59.005600Z

Does it not?

2019-05-27T16:37:11.006700Z

:)) Yeah It does Thanks @gfredericks (Sorry to bother you)

๐Ÿ‘ 1