Add rspec run-command recipe

This commit is contained in:
Jeremy Dormitzer 2024-04-04 19:55:25 +00:00
parent ab33b91416
commit 251268265b

View File

@ -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)