Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions expectations-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,16 @@
(defun expectations-eval (string &optional handler stdout-handler synch)
(if synch
(funcall handler (current-buffer)
(plist-get (nrepl-send-string-sync string (cider-current-ns)) :value)
(nrepl-dict-get (nrepl-sync-request:eval string (cider-current-connection) (cider-current-session) (cider-current-ns)) "value")
synch)
(nrepl-send-string string
(expectations-response-handler (or handler #'identity) stdout-handler)
(cider-current-ns))))

(cider-nrepl-send-request
(list "op" "eval"
"ns" (cider-current-ns)
"code" string
"session" (cider-current-session))
(expectations-response-handler (or handler #'identity) stdout-handler))))


(defun expectations-test-clear (&optional callback synch)
"Clear all counters and unmap generated vars for expectations"
Expand Down Expand Up @@ -257,9 +262,9 @@ it."
(let* ((ns (match-string 2))
(filename
(read
(plist-get (nrepl-send-string-sync (format "(-> \"%s\" symbol ns-publics first val meta :file)" ns)
(cider-current-ns))
:value))))
(nrepl-dict-get (nrepl-sync-request:eval (format "(-> \"%s\" symbol ns-publics first val meta :file)" ns)
(cider-current-connection) (cider-current-session) (cider-current-ns) )
"value"))))
(list filename)))

(defun expectations-kill-compilation-buffer ()
Expand Down Expand Up @@ -324,7 +329,7 @@ it."
(sort-by (comp :line meta) (vals (ns-publics (find-ns '%s))))))"
(line-number-at-pos)
(cider-current-ns))))
(plist-get (nrepl-send-string-sync clj (cider-current-ns)) :value)))
(nrepl-dict-get (nrepl-sync-request:eval clj (cider-current-connection) (cider-current-session) (cider-current-ns)) "value")))

(defun expectations-run-test (&optional synch)
"Run test at point"
Expand Down