tpope / vim-fireplace

fireplace.vim: Clojure REPL support
https://www.vim.org/scripts/script.php?script_id=4978
1.75k stars 139 forks source link

Run (single) test under cursor with fixtures applied #231

Closed nberger closed 9 years ago

nberger commented 9 years ago

Use test-vars instead of test-var so the test runs with the fixtures applied. That's the expected behavior when running a test. It's also what's being done when multiple tests are matched.

As an example:

(require '[clojure.test :refer :all])

(def ^:dynamic *a* 0)

(defn set-a1 [f]
  (binding [*a* 1]
    (f)))

(use-fixtures :each set-a1)

(deftest a-test
  (is (= *a* 1)))

(test-var #'a-test) ;=> FAIL

(test-vars [#'a-test]) ;=> OK