Skip to content

Instantly share code, notes, and snippets.

(defun find-java-src ()
(interactive)
(er/mark-word)
(let* ((project-root (locate-dominating-file (file-name-directory (buffer-file-name)) "project.clj"))
(the-str (buffer-substring-no-properties (region-beginning) (region-end))))
(if project-root
(progn
(grep-string-in the-str
(concat project-root "lib/sources"))
(switch-to-grep)
(expect (interaction (log :warn anything&))
(log :warn "order" 1 "at" (time/now)))
(expect (interaction (my-fn anything&) :never)
(a-fn-that-shouldnt-call-my-fn))
(expect (interaction (my-fn anything) :never)
(a-fn-that-shouldnt-call-my-fn))
(ns success.success-examples
(:use expectations erajure.core))
;; mock interaction based testing
(expect-let [r (mock Runnable)]
(interaction (.run r))
(.run r))
(ns synchro.core)
;; server
(defonce server-list (atom []))
(defonce appender (atom nil))
(defonce appending-fiber (atom nil))
(defonce subscriber (atom identity))
(defonce synchro-fiber (atom nil))
(ns synchro.core)
;; server
(defonce server-list (atom []))
(defonce appender (atom nil))
(defonce appending-fiber (atom nil))
(defonce subscriber (atom identity))
(defn subscribe [f]
(ns synchro.core)
;; server
(defonce server-list (atom []))
(defonce appender (atom nil))
(defonce appending-fiber (atom nil))
(defonce subscriber (atom identity))
(defn subscribe [f]
;; client
(defonce client-list (atom nil))
(defn handle-update [{:keys [type val]}]
(if (= type :snapshot)
(reset! client-list val)
(when @client-list
(when (< 9 (count @client-list))
(swap! client-list butlast))
(swap! client-list conj val))))
;; server
(defonce server-list (atom []))
(defonce appender (atom nil))
(defonce appending-fiber (atom nil))
(defonce subscriber (atom identity))
(defn subscribe [f]
(reset! subscriber f))