Skip to content

Instantly share code, notes, and snippets.

@shargoj
Created August 26, 2014 16:02
Show Gist options
  • Save shargoj/a9c403387c98d5679b77 to your computer and use it in GitHub Desktop.
Save shargoj/a9c403387c98d5679b77 to your computer and use it in GitHub Desktop.
(defun jim/cider-test-is-test-ns (ns)
(let ((suffix "-test"))
(string-match (rx-to-string `(: ,suffix eos) t) ns)))
(defun jim/cider-test-impl-ns-fn (ns)
(when ns
(let ((suffix "-test"))
(if (string-match (rx-to-string `(: ,suffix eos) t) ns)
(s-replace suffix "" ns)
ns))))
(defun jim/cider-test-jump-around ()
(interactive)
(let ((ns (cider-current-ns)))
(switch-to-buffer
(cider-find-buffer
(if (jim/cider-test-is-test-ns ns)
(jim/cider-test-impl-ns-fn ns)
(cider-test-default-test-ns-fn ns))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment