Skip to content

Commit 353cb29

Browse files
ikappakibbatsov
authored andcommitted
spy-on `read-file-name' directly to fake user input
`completing-read' does not appear to be working for that purpose on GH CI for MS-Windows.
1 parent 87c2948 commit 353cb29

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

test/integration/integration-tests.el

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,13 @@
410410
;; select nbb
411411
("No project found in current dir, select project type to jack in: "
412412
"nbb")
413-
;; project src directory, use suggested
414-
("Project: " initial-input)
413+
(_ (error ":integration-test-unsupported-prompt-error %S" prompt)))))
414+
(spy-on 'read-file-name
415+
:and-call-fake (lambda (prompt &optional dir _default-filename _mustmatch
416+
_initial _predicate)
417+
(pcase prompt
418+
;; project src directory
419+
("Project: " dir)
415420
(_ (error ":integration-test-unsupported-prompt-error %S" prompt)))))
416421

417422
(with-temp-buffer
@@ -471,12 +476,12 @@
471476
;; setup empty dir
472477
(let* ((project-dir temp-dir))
473478
;; fake user input
474-
(spy-on 'completing-read
475-
:and-call-fake (lambda (prompt _collection &optional _predicate _require-match
476-
initial-input _hist _def _inherit-input-method)
479+
(spy-on 'read-file-name
480+
:and-call-fake (lambda (prompt &optional dir _default-filename _mustmatch
481+
_initial _predicate)
477482
(pcase prompt
478483
;; project src directory
479-
("Project: " initial-input)
484+
("Project: " dir)
480485
(_ (error ":integration-test-unsupported-prompt-error %S" prompt)))))
481486
(with-temp-buffer
482487
;; set default directory to temp project

0 commit comments

Comments
 (0)