Skip to content

Instantly share code, notes, and snippets.

@jhirn
Created January 5, 2011 02:40
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 jhirn/765844 to your computer and use it in GitHub Desktop.
Save jhirn/765844 to your computer and use it in GitHub Desktop.
This patch worked for me.
diff --git a/rspec-mode.el b/rspec-mode.el
index 22caf94..57fe566 100644
--- a/rspec-mode.el
+++ b/rspec-mode.el
@@ -356,7 +356,10 @@
(if rspec-use-rvm
(rvm-activate-corresponding-ruby))
(rspec-register-verify-redo (cons 'rspec-run opts))
- (compile (mapconcat 'identity (list (rspec-runner) (rspec-spec-directory (rspec-project-root)) (rspec-runner-options opts)) " "))
+ (let ((curdir (file-name-as-directory default-directory)))
+ (setq default-directory (rspec-project-root))
+ (compile (mapconcat 'identity (list (rspec-runner) (rspec-spec-directory (rspec-project-root)) (rspec-runner-options opts)) " "))
+ (setq default-directory curdir))
(end-of-buffer-other-window 0))
(defun rspec-run-single-file (spec-file &rest opts)
@@ -364,7 +367,10 @@
(if rspec-use-rvm
(rvm-activate-corresponding-ruby))
(rspec-register-verify-redo (cons 'rspec-run-single-file (cons spec-file opts)))
- (compile (mapconcat 'identity (list (rspec-runner) (rspec-runner-target spec-file) (rspec-runner-options opts)) " "))
+ (let ((curdir (file-name-as-directory default-directory)))
+ (setq default-directory (rspec-project-root))
+ (compile (mapconcat 'identity (list (rspec-runner) (rspec-runner-target spec-file) (rspec-runner-options opts)) " "))
+ (setq default-directory curdir))
(end-of-buffer-other-window 0))
(defun rspec-project-root (&optional directory)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment