Skip to content

Instantly share code, notes, and snippets.

@jaycfields
Last active October 12, 2015 06:58
Show Gist options
  • Save jaycfields/3988687 to your computer and use it in GitHub Desktop.
Save jaycfields/3988687 to your computer and use it in GitHub Desktop.
tests that use redef-state
(ns blog-expectations
(:use expectations
[blog :as b]))
(expect {"CNN" {:src "CNN" :headline "Election Update"}
"NY Times" {:src "NY Times" :headline "Movie Guide"}}
(redef-state [blog]
(b/process-update {:src "NY Times" :headline "Market News"})
(b/process-update {:src "CNN" :headline "Election Update"})
(b/process-update {:src "NY Times" :headline "Movie Guide"})
@last-update))
(expect {"CNN" [{:src "CNN", :headline "Election Update"}]
"NY Times" [{:src "NY Times", :headline "Movie Guide"}
{:src "NY Times", :headline "Market News"}]}
(redef-state [blog]
(b/process-update {:src "NY Times" :headline "Market News"})
(b/process-update {:src "CNN" :headline "Election Update"})
(b/process-update {:src "NY Times" :headline "Movie Guide"})
@all-updates))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment