Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(ns ybot.kwphrase-tests
(:use [ybot.analytics.ga kwphrase]
[ybot datastores]
[midje sweet cascalog]))
(let [ga-data [["20121025"
"http://dopeness.org"
"United States"
"Oregon"
"Portland"
"filtered"
"google"
"5"
"2"
"2"
"true"
"2"
"0"]
["20121025"
"http://dopeness.org"
"United States"
"Oregon"
"Portland"
"passed"
"google"
"8"
"4"
"4"
"true"
"4"
"0"]]
ngram-data [["filtered" "filtered"]
["passed" "passed"]]]
(fact
(landings-by-ngram (gadata-tap :ga-tap) (ngram-generator :ngram-gen) 3)
=not=> (produces-some [["filtered" 2 5 2 2 0 100.0 100.0 0 2.5]])
(provided
(gadata-tap :ga-tap) => ga-data
(ngram-generator :ngram-gen) => ngram-data)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.