From 2420bd60ca43bc2e091a9802e55efc42522e0723 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Sat, 15 Nov 2014 17:58:32 +0200 Subject: [Fix #784] Make it possible to run tests in the current ns with `C-u C-c ,` --- cider-test.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'cider-test.el') 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"))) -- cgit v1.2.3