Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
Fixed broken test runner.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmexe committed Mar 4, 2009
1 parent bcb38bb commit 802802f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bundles/rails-rspec-bundle.el
Expand Up @@ -2,7 +2,7 @@
;;; - Variables
;;;

(defvar rails/rspec-bundle/command "spec")
(defvar rails/rspec-bundle/command (format "%s script/spec" rails/ruby/command))
(defvar rails/rspec-bundle/spec-options "-O spec/spec.opts")

;;; ---------------------------------------------------------
Expand Down
14 changes: 10 additions & 4 deletions rails-compile.el
Expand Up @@ -87,18 +87,24 @@
(defun rails/compile/run-file (root rails-buffer command args-pattern &optional file-pattern)
(let ((item
(when rails-buffer
(rails/resources/get-associated-test-item-for-buffer root
rails-buffer)))
(rails/resources/get-associated-test-item-for-buffer
root
rails-buffer)))
(match (when file-pattern
(string-ext/string=~ file-pattern
(rails/resource-buffer-file rails-buffer)
t)))
file)
(cond
(item
((and item
(if file-pattern match t))
(setq file (rails/resource-item-file item))
(rails/compile/run root
command
(format args-pattern
file)))
((and file-pattern
(string-ext/string=~ file-pattern (buffer-file-name) t))
match)
(rails/compile/run root
command
(format args-pattern
Expand Down
6 changes: 3 additions & 3 deletions rails-reloaded.el
Expand Up @@ -213,9 +213,9 @@
(define-keys map
([menu-bar] (rails-minor-mode-menu-bar-map))
((rails/short-key "<up>") 'rails/resources/toggle)
((rails/short-key "<return>") 'rails/resources/toggle-test)
((rails/short-key ";") 'rails/goto-associated)
((rails/short-key "'") 'rails/goto)
((rails/short-key "t") 'rails/resources/toggle-test)
((rails/short-key "'") 'rails/goto-associated)
((rails/short-key ";") 'rails/goto)
((rails/short-key "/") 'rails/runner/toggle-output-window)
((kbd "\e\e e") 'rails/set-default-environment)
((rails/key ".") 'rails/compile/single-file)
Expand Down
13 changes: 8 additions & 5 deletions rails-resources.el
Expand Up @@ -442,12 +442,15 @@
(let ((test-res (rails/resources/test-buffer-p root rails-buffer)))
(if test-res
;; it's the test, run it
(rails/resources/get-associated-items-by-resource root
rails-buffer
test-res)
(car
(rails/resources/get-associated-items-by-resource
root
rails-buffer
test-res))
;; it's have the link to test
(rails/resources/linked-to-test-item-of-buffer root
rails-buffer))))
(rails/resources/linked-to-test-item-of-buffer
root
rails-buffer))))

(defun rails/resources/toggle-test ()
(interactive)
Expand Down
5 changes: 4 additions & 1 deletion rails-runner.el
Expand Up @@ -122,14 +122,17 @@ BUFFER-MAJOR-MODE."
(with-current-buffer (get-buffer rails/runner/buffer-name)
(let ((buffer-read-only nil))
(delete-region (point-min) (point-max)))))
(in-directory root
(in-directory (if (string-ext/end-p root "/")
root (concat root "/"))
(let ((proc (rails/proxy/shell-command root
rails/runner/buffer-name
rails/runner/buffer-name
command
parameters)))
(rails/runner/prepare-buffer proc)
(with-current-buffer (process-buffer proc)
(setq default-directory (if (string-ext/end-p root "/")
root (concat root "/")))
(if (opt-val :mode options)
(funcall (opt-val :mode options))
(rails/runner/output-mode))
Expand Down

0 comments on commit 802802f

Please sign in to comment.