summaryrefslogtreecommitdiff
path: root/cider-test.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@tradeo.com>2014-11-15 17:58:32 +0200
committerBozhidar Batsov <bozhidar@tradeo.com>2014-11-15 17:58:32 +0200
commit2420bd60ca43bc2e091a9802e55efc42522e0723 (patch)
tree5fc0ac9b770268fdeb641dbf8b2d7a6ca86035af /cider-test.el
parentf1d75e47fadd5700a828048b448529adddf1829f (diff)
[Fix #784] Make it possible to run tests in the current ns with `C-u C-c ,`
Diffstat (limited to 'cider-test.el')
-rw-r--r--cider-test.el17
1 files changed, 11 insertions, 6 deletions
diff --git a/cider-test.el b/cider-test.el
index 3c5d5b44..337c69e7 100644
--- a/cider-test.el
+++ b/cider-test.el
@@ -435,12 +435,17 @@ displayed. When test failures/errors occur, their sources are highlighted."
(cider-test-execute ns t)
(message "No namespace to retest")))
-(defun cider-test-run-tests ()
- "Run all tests for the current Clojure source or test report context."
- (interactive)
- (-if-let (ns (or (funcall cider-test-infer-test-ns (clojure-find-ns))
- (when (eq major-mode 'cider-test-report-mode)
- cider-test-last-test-ns)))
+(defun cider-test-run-tests (suppress-inference)
+ "Run all tests for the current Clojure source or test report context.
+
+With a prefix arg SUPPRESS-INFERENCE it will try to run the tests in the
+current ns."
+ (interactive "P")
+ (-if-let (ns (if suppress-inference
+ (clojure-find-ns)
+ (or (funcall cider-test-infer-test-ns (clojure-find-ns))
+ (when (eq major-mode 'cider-test-report-mode)
+ cider-test-last-test-ns))))
(cider-test-execute ns nil)
(message "No namespace to test in current context")))