Skip to content

Commit 524dea5

Browse files
author
Bozhidar Batsov
committed
[#784] Document the existence of cider-test-infer-test-ns and make it a defcustom
1 parent ee3fdfb commit 524dea5

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,11 @@ helpful for identifying each host.
356356
Note that the history is written to the file when you kill the REPL
357357
buffer (which includes invoking `cider-quit`) or you quit Emacs.
358358

359+
* If your tests are not following the `some.ns-test` naming convention you can
360+
customize the variable `cider-test-infer-test-ns`. It should be bound to a
361+
function that takes the current ns and returns the matching test ns (which may
362+
be the same as the current ns).
363+
359364
### Minibuffer completion
360365

361366
Out-of-the box `CIDER` uses the standard `completing-read` Emacs mechanism. While it's not

cider-test.el

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,13 @@ With the actual value, the outermost '(not ...)' s-expression is removed."
380380
;; its corresponding test namespace. To provide this, we need to map the
381381
;; relationship between those namespaces.
382382

383-
(defvar cider-test-infer-test-ns 'cider-test-default-test-ns-fn
383+
(defcustom cider-test-infer-test-ns 'cider-test-default-test-ns-fn
384384
"Function to infer the test namespace for NS.
385385
The default implementation uses the simple Leiningen convention of appending
386-
'-test' to the namespace name.")
386+
'-test' to the namespace name."
387+
:type 'symbol
388+
:group 'cider-test
389+
:package-version '(cider . "0.7.0"))
387390

388391
(defun cider-test-default-test-ns-fn (ns)
389392
"For a NS, return the test namespace, which may be the argument itself.

0 commit comments

Comments
 (0)