Skip to content

Commit

Permalink
Add: custom variable for minitest spring command (#41)
Browse files Browse the repository at this point in the history
* Don't hardcode the spring command

Since we may need a different (i.e. non-standard) way of executing the tests, this patch makes it configurable.

* PR feedback

Improved indentation (my fault, apologies).
Improved test to explicitly test new customization variable.

* Fix unit test
  • Loading branch information
ZenAnnard authored and Grant Shangreaux committed Dec 29, 2019
1 parent 68c16d5 commit 6d9f623
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion minitest.el
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,16 @@
:type 'list
:group 'minitest)

(defcustom minitest-spring-command '("spring" "rake" "test")
"Spring command for minitest"
:type 'list
:group 'minitest)

(defun minitest-buffer-name (file-or-dir)
(concat "*Minitest " file-or-dir "*"))

(defun minitest-test-command ()
(let ((command (cond (minitest-use-spring '("spring" "rake" "test"))
(let ((command (cond (minitest-use-spring minitest-spring-command)
((minitest-zeus-p) '("zeus" "test"))
(minitest-use-rails '("bin/rails" "test"))
(t minitest-default-command))))
Expand Down
2 changes: 1 addition & 1 deletion test/minitest-unit-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

(ert-deftest test-minitest-test-command ()
(let ((minitest-use-spring t))
(should (equal (minitest-test-command) '("spring" "rake" "test"))))
(should (equal (minitest-test-command) minitest-spring-command)))
(let ((minitest-use-docker t)
(minitest-docker-container "app")
(minitest-use-rails t))
Expand Down

0 comments on commit 6d9f623

Please sign in to comment.