Created
July 16, 2014 15:28
-
-
Save wilkerlucio/35d75b73b89f2a530f3d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns joy.unit-testing | |
| (:require [joy.futures :as joy])) | |
| (def stubbed-feed-children | |
| (constantly [{:content [{:tag :title | |
| :content ["Stub"]}]}])) | |
| (defn count-feed-entries [url] | |
| (count (joy/feed-children url))) | |
| (count-feed-entries "http://blog.fogus.me/feed/") | |
| ;;=> 5 | |
| (with-redefs [joy/feed-children stubbed-feed-children] (count-feed-entries "dummy url")) | |
| ;;=> 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment