branch: elpa/cider
commit 353cb29820929b1e818c53137a91e766130c196d
Author: ikappaki <ikapp...@users.noreply.github.com>
Commit: Bozhidar Batsov <bozhi...@batsov.dev>

    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.
---
 test/integration/integration-tests.el | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/test/integration/integration-tests.el 
b/test/integration/integration-tests.el
index e2b93645a9..dd4907a86a 100644
--- a/test/integration/integration-tests.el
+++ b/test/integration/integration-tests.el
@@ -410,8 +410,13 @@
                                      ;; select nbb
                                      ("No project found in current dir, select 
project type to jack in: "
                                       "nbb")
-                                     ;; project src directory, use suggested
-                                     ("Project: " initial-input)
+                                     (_ (error 
":integration-test-unsupported-prompt-error %S" prompt)))))
+          (spy-on 'read-file-name
+                  :and-call-fake (lambda (prompt &optional dir 
_default-filename _mustmatch
+                                                 _initial _predicate)
+                                   (pcase prompt
+                                     ;; project src directory
+                                     ("Project: " dir)
                                      (_ (error 
":integration-test-unsupported-prompt-error %S" prompt)))))
 
           (with-temp-buffer
@@ -471,12 +476,12 @@
         ;; setup empty dir
         (let* ((project-dir temp-dir))
           ;; fake user input
-          (spy-on 'completing-read
-                  :and-call-fake (lambda (prompt _collection &optional 
_predicate _require-match
-                                                 initial-input _hist _def 
_inherit-input-method)
+          (spy-on 'read-file-name
+                  :and-call-fake (lambda (prompt &optional dir 
_default-filename _mustmatch
+                                                 _initial _predicate)
                                    (pcase prompt
                                      ;; project src directory
-                                     ("Project: " initial-input)
+                                     ("Project: " dir)
                                      (_ (error 
":integration-test-unsupported-prompt-error %S" prompt)))))
           (with-temp-buffer
             ;; set default directory to temp project

Reply via email to