Skip to content

Commit

Permalink
Add ability to configure arguments to plain test runner.
Browse files Browse the repository at this point in the history
  • Loading branch information
mijoharas authored and icostan committed May 21, 2020
1 parent c72caae commit 60b599f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ruby-test-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
;;
;; C-c C-s - Toggle between implementation and test/example files.


(require 'ruby-mode)
(require 'pcre2el)

Expand All @@ -75,6 +74,13 @@ Test Driven Development in Ruby."
:type '(list)
:group 'ruby-test)

(defcustom ruby-test-plain-test-options
'()
"Pass extra command line options to minitest when running specs"
:initialize 'custom-initialize-default
:type '(list)
:group 'ruby-test)

(defvar ruby-test-default-library
"test"
"Define the default test library.")
Expand Down Expand Up @@ -437,7 +443,11 @@ and replace the match with the second element."
(setq name-options (format "--name \"/%s/\"" test-case))
(error "No test case at %s:%s" filename line-number)))
(setq name-options ""))
(format "%s %s %s %s" command (mapconcat 'identity options " ") filename name-options)))
(setq extra-options
(if (not (null ruby-test-plain-test-options))
(mapconcat 'identity ruby-test-plain-test-options " ")
""))
(format "%s %s %s %s %s" command (mapconcat 'identity options " ") filename name-options extra-options)))

(defun ruby-test-project-root (filename root-predicate)
"Return the project root directory.
Expand Down

0 comments on commit 60b599f

Please sign in to comment.