Add rspec run-command recipe
This commit is contained in:
parent
ab33b91416
commit
251268265b
@ -364,6 +364,18 @@
|
||||
:working-dir root-dir))
|
||||
scripts)))
|
||||
|
||||
(defun run-command-recipe-rspec ()
|
||||
(when
|
||||
(and (derived-mode-p 'ruby-mode)
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(re-search-forward "RSpec" nil t)))
|
||||
(let ((root-dir (or (projectile-project-root) default-directory)))
|
||||
(list
|
||||
(list :command-name "test this file"
|
||||
:command-line (format "rspec %s" (buffer-file-name))
|
||||
:working-dir root-dir)))))
|
||||
|
||||
:general
|
||||
(leader-map "\"" #'run-command)
|
||||
:custom
|
||||
@ -386,6 +398,7 @@
|
||||
run-command-recipe-maven
|
||||
run-command-recipe-cargo
|
||||
run-command-recipe-rake
|
||||
run-command-recipe-scripts)))
|
||||
run-command-recipe-scripts
|
||||
run-command-recipe-rspec)))
|
||||
|
||||
(provide 'init-run-command)
|
||||
|
Loading…
Reference in New Issue
Block a user