Skip to content

Commit 5d003b5

Browse files
committed
Add test for cider-var-info lookup op fallback
1 parent a569a5f commit 5d003b5

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/cider-client-tests.el

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@
6262
(expect (nrepl-dict-get (cider-var-info "str") "doc")
6363
:to-equal "stub"))
6464

65+
(it "falls back to lookup when info op is not available"
66+
(spy-on 'cider-sync-request:lookup :and-return-value
67+
'(dict
68+
"arglists" "([] [x] [x & ys])"
69+
"ns" "clojure.core"
70+
"name" "str"
71+
"doc" "stub"))
72+
(spy-on 'cider-nrepl-op-supported-p :and-call-fake
73+
(lambda (op &optional conn)
74+
(string= op "lookup")))
75+
(expect (nrepl-dict-get (cider-var-info "str") "doc")
76+
:to-equal "stub"))
77+
6578
(it "returns nil in the absence of the info and lookup middleware"
6679
(spy-on 'cider-nrepl-op-supported-p :and-return-value nil)
6780
(expect (cider-var-info "str") :to-equal nil)))

0 commit comments

Comments
 (0)