Created
September 30, 2015 12:16
-
-
Save lsgrep/f89d6b5afb1fac7e4ded to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun clojure-test-filename () | |
(concat (projectile-project-root) | |
"test/" | |
(mapconcat #'identity | |
(butlast (split-string (cider-current-ns) "\\.")) "/") | |
"/" | |
(file-name-nondirectory (file-name-sans-extension (buffer-file-name))) | |
"_test.clj")) | |
(defadvice projectile-toggle-between-implementation-and-test (around create-clojure-test-advice) | |
"Visit new file if can't find test" | |
(condition-case nil | |
ad-do-it | |
(error (find-file (clojure-test-filename))))) | |
(ad-activate 'projectile-toggle-between-implementation-and-test) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment