Skip to content

Commit 2420bd6

Browse files
author
Bozhidar Batsov
committed
[Fix #784] Make it possible to run tests in the current ns with C-u C-c ,
1 parent f1d75e4 commit 2420bd6

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ are used to translate filenames from/to the nREPL server (default Cygwin impleme
2626
* New interactive command `cider-describe-nrepl-session`.
2727
* New interactive command `cider-toggle-trace-ns` (mapped to <kbd>C-c M-t n</kbd>)
2828
* New interactive command `cider-repl-require-repl-utils`.
29+
* [#784](https://github.com/clojure-emacs/cider/issues/784): Make it possible to run tests in
30+
the current ns with `C-u C-c ,`.
2931

3032
### Changes
3133

cider-test.el

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,12 +435,17 @@ displayed. When test failures/errors occur, their sources are highlighted."
435435
(cider-test-execute ns t)
436436
(message "No namespace to retest")))
437437

438-
(defun cider-test-run-tests ()
439-
"Run all tests for the current Clojure source or test report context."
440-
(interactive)
441-
(-if-let (ns (or (funcall cider-test-infer-test-ns (clojure-find-ns))
442-
(when (eq major-mode 'cider-test-report-mode)
443-
cider-test-last-test-ns)))
438+
(defun cider-test-run-tests (suppress-inference)
439+
"Run all tests for the current Clojure source or test report context.
440+
441+
With a prefix arg SUPPRESS-INFERENCE it will try to run the tests in the
442+
current ns."
443+
(interactive "P")
444+
(-if-let (ns (if suppress-inference
445+
(clojure-find-ns)
446+
(or (funcall cider-test-infer-test-ns (clojure-find-ns))
447+
(when (eq major-mode 'cider-test-report-mode)
448+
cider-test-last-test-ns))))
444449
(cider-test-execute ns nil)
445450
(message "No namespace to test in current context")))
446451

0 commit comments

Comments
 (0)