Skip to content

Instantly share code, notes, and snippets.

@sideshowcoder
Created February 9, 2017 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sideshowcoder/66677f6268e6f5a65260c5a631da76ab to your computer and use it in GitHub Desktop.
Save sideshowcoder/66677f6268e6f5a65260c5a631da76ab to your computer and use it in GitHub Desktop.
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