Skip to content

Instantly share code, notes, and snippets.

@martinklepsch
Created January 6, 2015 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinklepsch/dbcc7702b36b7e879419 to your computer and use it in GitHub Desktop.
Save martinklepsch/dbcc7702b36b7e879419 to your computer and use it in GitHub Desktop.
(deftest notification-unsuccessful
(testing "Notification check-fn not fulfilled"
(let [requests (atom [])]
(reset! requests [])
(with-fake-http [test-uri (fn [orig-fn opts callback]
(swap! requests conj (:url opts))
{:status 200 :body "ok"})]
(n/notify test-uri #(= % "bla") :wait-times [1 2 3 4])
(Thread/sleep 100) ; Urgs
(is (= 5 (count @requests)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment