Created
November 3, 2012 17:20
-
-
Save jaycfields/4008006 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 test-full-path (project-root test-home) | |
(concat | |
(replace-regexp-in-string | |
(concat (expand-file-name project-root) "src/clojure") | |
(concat project-root test-home) | |
(file-name-sans-extension (buffer-file-name))) | |
"_expectations.clj")) | |
(defun find-expectations () | |
(interactive) | |
(let* ((project-root (locate-dominating-file | |
(file-name-directory (buffer-file-name)) "project.clj"))) | |
(if project-root | |
(let* ((full-path-with-clojure (test-full-path project-root | |
"test/clojure/expectations"))) | |
(if (file-exists-p full-path-with-clojure) | |
(set-window-buffer (next-window) (find-file-noselect full-path-with-clojure)) | |
(message (concat "cound not find " full-path-with-clojure)))) | |
(message (concat "no project.clj found at or below " (buffer-file-name)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment