branch: elpa/cider
commit 5d003b579c7a7b55321c6e4e672f0f57b4021930
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Add test for cider-var-info lookup op fallback
---
test/cider-client-tests.el | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/test/cider-client-tests.el b/test/cider-client-tests.el
index 3b5bea665a..88e3c866f9 100644
--- a/test/cider-client-tests.el
+++ b/test/cider-client-tests.el
@@ -62,6 +62,19 @@
(expect (nrepl-dict-get (cider-var-info "str") "doc")
:to-equal "stub"))
+ (it "falls back to lookup when info op is not available"
+ (spy-on 'cider-sync-request:lookup :and-return-value
+ '(dict
+ "arglists" "([] [x] [x & ys])"
+ "ns" "clojure.core"
+ "name" "str"
+ "doc" "stub"))
+ (spy-on 'cider-nrepl-op-supported-p :and-call-fake
+ (lambda (op &optional conn)
+ (string= op "lookup")))
+ (expect (nrepl-dict-get (cider-var-info "str") "doc")
+ :to-equal "stub"))
+
(it "returns nil in the absence of the info and lookup middleware"
(spy-on 'cider-nrepl-op-supported-p :and-return-value nil)
(expect (cider-var-info "str") :to-equal nil)))