Skip to content

Instantly share code, notes, and snippets.

@sorenmacbeth
Created January 26, 2012 22:43
Show Gist options
  • Save sorenmacbeth/1685585 to your computer and use it in GitHub Desktop.
Save sorenmacbeth/1685585 to your computer and use it in GitHub Desktop.
(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