Skip to content

Instantly share code, notes, and snippets.

@sideshowcoder
Created February 9, 2017 14:38
Run rspec on file in emacs (depends on rake.el and projectile)
(defun coder/rspec-file ()
"Run rspec on the current file and set as the compile target,
if we have zeus available than run it via zeus otherwise run it
via bundle exec rspec"
(interactive)
(projectile-with-default-dir (projectile-project-root)
(let ((command-prefix (rake--choose-command-prefix (projectile-project-root) (list :zeus "zeus test "
:bundler "bundle exec rspec "))))
(compile (concat command-prefix (coder/project-relative-current-file-path))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment