Skip to content

Instantly share code, notes, and snippets.

@jmglov
jmglov / spec_test_utils.clj
Created September 14, 2016 12:53
Utility functions for using `clojure.spec` generative tests in standard `clojure.test` unit tests.
(ns spec-test-utils
(:require [clojure.spec.test :as stest]
[clojure.test :refer [is testing]]))
(defn- check [function num-tests]
(if num-tests
(stest/check function {:clojure.spec.test.check/opts {:num-tests num-tests}})
(stest/check function)))
(defn checking